♻️ Better file upload error

This commit is contained in:
2025-10-02 01:14:03 +08:00
parent 909fe173c2
commit 97a7b876db
10 changed files with 76 additions and 63 deletions

View File

@@ -316,9 +316,9 @@ public class CacheServiceRedis : ICacheService
public async Task<IEnumerable<string>> GetGroupKeysAsync(string group)
{
if (string.IsNullOrEmpty(group))
throw new ArgumentException(@"Group cannot be null or empty.", nameof(group));
throw new ArgumentException("Group cannot be null or empty.", nameof(group));
var groupKey = $"{GroupKeyPrefix}{group}";
var groupKey = string.Concat(GroupKeyPrefix, group);
var members = await _database.SetMembersAsync(groupKey);
return members.Select(m => m.ToString());
@@ -396,4 +396,4 @@ public class CacheServiceRedis : ICacheService
var result = await func();
return (true, result);
}
}
}

View File

@@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Google.Api.CommonProtos" Version="2.17.0" />
<PackageReference Include="Google.Protobuf" Version="3.31.1" />
<PackageReference Include="Google.Protobuf" Version="3.32.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.31.1" />
<PackageReference Include="Grpc" Version="2.46.6" />
<PackageReference Include="Grpc.AspNetCore.Server.ClientFactory" Version="2.71.0" />

View File

@@ -35,7 +35,7 @@ public class PolicyConfig
public bool AllowAnonymous { get; set; } = true;
public List<string>? AcceptTypes { get; set; }
public long? MaxFileSize { get; set; }
public int RequirePrivilege { get; set; } = 0;
public int? RequirePrivilege { get; set; } = 0;
}
public class FilePool : ModelBase, IIdentifiedResource
@@ -47,8 +47,8 @@ public class FilePool : ModelBase, IIdentifiedResource
[Column(TypeName = "jsonb")] public BillingConfig BillingConfig { get; set; } = new();
[Column(TypeName = "jsonb")] public PolicyConfig PolicyConfig { get; set; } = new();
public bool IsHidden { get; set; } = false;
public Guid? AccountId { get; set; }
public string ResourceIdentifier => $"file-pool/{Id}";
}
}