This commit is contained in:
Liang Ding 2022-10-02 12:08:49 +08:00
parent 3df605d2e7
commit 18829239d0
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 374 additions and 2 deletions

View file

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