1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-07-01 08:10:27 +08:00

finish chkdup

This commit is contained in:
源文雨
2023-05-04 23:05:40 +08:00
parent f5c5d0d526
commit ad46584760
9 changed files with 466 additions and 41 deletions

View File

@@ -83,13 +83,13 @@ func (f *FileDatabase) SaveFileToTemp(uploader int, file io.Reader, name string)
}
// ListUploadedFile will select all file that HasntAnalyzed && IsTemp or !HasntAnalyzed && !IsTemp
func (f *FileDatabase) ListUploadedFile(istemp *bool) (lst []*List, err error) {
func (f *FileDatabase) ListUploadedFile(istemp *bool, uid int) (lst []*List, err error) {
q := ""
switch {
case istemp == nil:
q = "ORDER BY UpTime DESC"
q = "WHERE (NOT IsTemp) OR (Uploader=" + strconv.Itoa(uid) + ") ORDER BY UpTime DESC"
case *istemp:
q = "WHERE IsTemp ORDER BY UpTime DESC"
q = "WHERE IsTemp AND Uploader=" + strconv.Itoa(uid) + " ORDER BY UpTime DESC"
default:
q = "WHERE (HasntAnalyzed AND IsTemp) OR (NOT HasntAnalyzed AND NOT IsTemp) ORDER BY UpTime DESC"
}