Finish the System Cleanup feature.

This commit is contained in:
zicla
2019-04-04 03:14:47 +08:00
parent 7697891807
commit 5936f917b3
15 changed files with 158 additions and 15 deletions

View File

@ -58,3 +58,10 @@ func (this *DownloadTokenDao) Save(downloadToken *DownloadToken) *DownloadToken
return downloadToken
}
//执行清理操作
func (this *DownloadTokenDao) Cleanup() {
this.logger.Info("[DownloadTokenDao]执行清理清除数据库中所有DownloadToken记录。")
db := CONTEXT.DB.Where("uuid is not null").Delete(DownloadToken{})
this.PanicError(db.Error)
}