1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-28 14:50:29 +08:00

finish 解析

This commit is contained in:
源文雨
2023-04-09 23:30:08 +08:00
parent 2fcb3fd636
commit fe1f3b1397
9 changed files with 217 additions and 115 deletions

View File

@@ -25,7 +25,7 @@ type List struct {
QuesC int // QuesC 总小题数
HasntAnalyzed bool // HasntAnalyzed whether file has been analyzed
IsTemp bool // IsTemp whether file is temp
Path string `db:"Path,UNIQUE"` // Path of file, unique
Path string // Path of file, normally unique
Desc string // Desc is file's description
}
@@ -89,3 +89,10 @@ func (f *FileDatabase) ListUploadedFile() (lst []*List, err error) {
FileDB.mu.RUnlock()
return
}
func (f *FileDatabase) GetFileInfo(id int) (lst List, err error) {
FileDB.mu.RLock()
lst, err = sql.Find[List](&FileDB.db, FileTableList, "WHERE ID="+strconv.Itoa(id))
FileDB.mu.RUnlock()
return
}