🎨 数据历史文档和资源文件支持分页和搜索 https://github.com/siyuan-note/siyuan/issues/4901

This commit is contained in:
Liang Ding 2022-08-29 11:57:19 +08:00
parent 10032fd154
commit 489736645c
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 53 additions and 101 deletions

View file

@ -36,7 +36,10 @@ func searchHistory(c *gin.Context) {
}
query := arg["query"].(string)
page := int(arg["page"].(float64))
page := 1
if nil != arg["page"] {
page = int(arg["page"].(float64))
}
histories := model.FullTextSearchHistory(query, page)
ret.Data = map[string]interface{}{
"histories": histories,
@ -75,7 +78,16 @@ func getAssetsHistory(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
histories, err := model.GetAssetsHistory()
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
page := 1
if nil != arg["page"] {
page = int(arg["page"].(float64))
}
histories, err := model.GetAssetsHistory(page)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()