mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
♻️ 重构 文件历史 查询 https://github.com/siyuan-note/siyuan/issues/6504
This commit is contained in:
parent
b0fe8b49ba
commit
24edac891e
4 changed files with 108 additions and 0 deletions
|
|
@ -61,6 +61,37 @@ func searchHistory(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func getHistoryItems(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
created := arg["created"].(string)
|
||||
|
||||
notebook := ""
|
||||
if nil != arg["notebook"] {
|
||||
notebook = arg["notebook"].(string)
|
||||
}
|
||||
typ := model.HistoryTypeDoc
|
||||
if nil != arg["type"] {
|
||||
typ = int(arg["type"].(float64))
|
||||
}
|
||||
|
||||
query := arg["query"].(string)
|
||||
op := "all"
|
||||
if nil != arg["op"] {
|
||||
op = arg["op"].(string)
|
||||
}
|
||||
histories := model.FullTextSearchHistoryItems(created, query, notebook, op, typ)
|
||||
ret.Data = map[string]interface{}{
|
||||
"items": histories,
|
||||
}
|
||||
}
|
||||
|
||||
func reindexHistory(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue