mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Feat: copy files and folders
This commit is contained in:
1 parent
85bbb3d122
commit
c15b8a047d
5 files changed
+162
-38
No files matched your search
@@ -85,6 +85,16 @@ func (user *User) IncreaseStorage(size uint64) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IncreaseStorageWithoutCheck 忽略可用容量,增加用户已用容量
|
||||
func (user *User) IncreaseStorageWithoutCheck(size uint64) {
|
||||
if size == 0 {
|
||||
return
|
||||
}
|
||||
user.Storage += size
|
||||
DB.Model(user).UpdateColumn("storage", gorm.Expr("storage + ?", size))
|
||||
|
||||
}
|
||||
|
||||
// GetRemainingCapacity 获取剩余配额
|
||||
func (user *User) GetRemainingCapacity() uint64 {
|
||||
if user.Group.MaxStorage <= user.Storage {
|
||||
|
||||
Reference in new issue
Block a user