mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
3df605d2e7
commit
18829239d0
4 changed files with 374 additions and 2 deletions
|
|
@ -73,6 +73,35 @@ func getBacklinkDoc(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
func getBacklink2(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
if nil == arg["id"] {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
keyword := arg["k"].(string)
|
||||
mentionKeyword := arg["mk"].(string)
|
||||
boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink2(id, keyword, mentionKeyword)
|
||||
ret.Data = map[string]interface{}{
|
||||
"backlinks": backlinks,
|
||||
"linkRefsCount": linkRefsCount,
|
||||
"backmentions": backmentions,
|
||||
"mentionsCount": mentionsCount,
|
||||
"k": keyword,
|
||||
"mk": mentionKeyword,
|
||||
"box": boxID,
|
||||
}
|
||||
}
|
||||
|
||||
func getBacklink(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue