Feat: WebDAV account management

This commit is contained in:
HFO4
2020-02-18 12:10:28 +08:00
parent 663b827a1d
commit 86889e2fac
6 changed files with 148 additions and 21 deletions

View File

@@ -53,11 +53,13 @@ func checkUserGroup() {
func checkStoragePack() {
packs := model.GetExpiredStoragePack()
for _, pack := range packs {
// 删除过期的容量包
pack.Delete()
//找到所属用户
user, err := model.GetUserByID(pack.ID)
user, err := model.GetUserByID(pack.UserID)
if err != nil {
util.Log().Warning("[定时任务] 无法获取用户 [UID=%d] 信息, %s", pack.ID, err)
util.Log().Warning("[定时任务] 无法获取用户 [UID=%d] 信息, %s", pack.UserID, err)
continue
}
@@ -66,9 +68,6 @@ func checkStoragePack() {
// 如果超额,则通知用户
sendNotification(&user, "容量包过期")
// 删除过期的容量包
pack.Delete()
// 更新最后通知日期
user.Notified()