Finish the delete feature.

This commit is contained in:
lishuang
2020-06-21 00:04:11 +08:00
parent 601c60fca7
commit 3fb1d874d5
14 changed files with 212 additions and 4 deletions

View File

@ -58,6 +58,13 @@ func (this *DownloadTokenDao) Save(downloadToken *DownloadToken) *DownloadToken
return downloadToken
}
func (this *DownloadTokenDao) DeleteByUserUuid(userUuid string) {
db := core.CONTEXT.GetDB().Where("user_uuid = ?", userUuid).Delete(DownloadToken{})
this.PanicError(db.Error)
}
func (this *DownloadTokenDao) Cleanup() {
this.logger.Info("[DownloadTokenDao] clean up. Delete all DownloadToken")
db := core.CONTEXT.GetDB().Where("uuid is not null").Delete(DownloadToken{})