Feat: list downloading file

This commit is contained in:
HFO4
2020-02-08 15:37:51 +08:00
parent 356ac8d608
commit d30159579f
6 changed files with 95 additions and 1 deletions

View File

@@ -71,6 +71,14 @@ func GetDownloadsByStatus(status ...int) []Download {
return tasks
}
// GetDownloadsByStatusAndUser 根据状态检索和用户ID下载
// TODO 测试
func GetDownloadsByStatusAndUser(uid uint, status ...int) []Download {
var tasks []Download
DB.Where("user_id = ? and status in (?)", uid, status).Find(&tasks)
return tasks
}
// GetDownloadByGid 根据GID和用户ID查找下载
func GetDownloadByGid(gid string, uid uint) (*Download, error) {
download := &Download{}