mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 数据历史文档和资源文件支持分页和搜索 https://github.com/siyuan-note/siyuan/issues/4901
This commit is contained in:
parent
10032fd154
commit
489736645c
2 changed files with 53 additions and 101 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue