fix(fileinfo_store): refactor file info store

This commit is contained in:
hexxa 2022-03-24 16:44:34 +08:00 committed by Hexxa
parent d65f1c4356
commit 41827f20c0
7 changed files with 194 additions and 175 deletions

View file

@ -32,7 +32,6 @@ type IUserStore interface {
GetUser(id uint64) (*db.User, error)
GetUserByName(name string) (*db.User, error)
SetInfo(id uint64, user *db.User) error
// CanIncrUsed(id uint64, capacity int64) (bool, error)
SetUsed(id uint64, incr bool, capacity int64) error
ResetUsed(id uint64, used int64) error
SetPwd(id uint64, pwd string) error
@ -322,6 +321,9 @@ func (us *KVUserStore) ListUsers() ([]*db.User, error) {
}
user.Pwd = ""
if err = db.CheckUser(user, true); err != nil {
return nil, err
}
users = append(users, user)
}