Hidden pool

This commit is contained in:
2025-08-09 01:09:47 +08:00
parent 2934225a6c
commit d8c1c63e56
5 changed files with 440 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ public class BillingConfig
public class PolicyConfig
{
public bool EnableFastUpload { get; set; } = false;
public bool EnableRecycle { get; set; } = false;
public bool PublicIndexable { get; set; } = false;
public bool PublicUsable { get; set; } = false;
@@ -47,6 +48,7 @@ public class FilePool : ModelBase, IIdentifiedResource
[Column(TypeName = "jsonb")] public RemoteStorageConfig StorageConfig { get; set; } = new();
[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; }

View File

@@ -18,6 +18,7 @@ public class FilePoolController(AppDatabase db, FileService fs) : ControllerBase
var accountId = Guid.Parse(currentUser.Id);
var pools = await db.Pools
.Where(p => p.PolicyConfig.PublicUsable || p.AccountId == accountId)
.Where(p => !p.IsHidden || p.AccountId == accountId)
.ToListAsync();
pools = pools.Select(p =>
{