mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: user storage pack
This commit is contained in:
@@ -105,10 +105,11 @@ func (user *User) IncreaseStorageWithoutCheck(size uint64) {
|
||||
|
||||
// GetRemainingCapacity 获取剩余配额
|
||||
func (user *User) GetRemainingCapacity() uint64 {
|
||||
if user.Group.MaxStorage <= user.Storage {
|
||||
total := user.Group.MaxStorage + user.GetAvailablePackSize()
|
||||
if total <= user.Storage {
|
||||
return 0
|
||||
}
|
||||
return user.Group.MaxStorage - user.Storage
|
||||
return total - user.Storage
|
||||
}
|
||||
|
||||
// GetPolicyID 获取用户当前的存储策略ID
|
||||
|
||||
Reference in New Issue
Block a user