This commit is contained in:
Liang Ding 2022-11-07 21:12:29 +08:00
parent b0fe8b49ba
commit 24edac891e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 108 additions and 0 deletions

View file

@ -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)