This commit is contained in:
Liang Ding 2022-10-05 10:29:00 +08:00
parent 7388c0d2a7
commit e34e7fe217
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 64 additions and 3 deletions

View file

@ -89,7 +89,17 @@ func getBacklink2(c *gin.Context) {
id := arg["id"].(string)
keyword := arg["k"].(string)
mentionKeyword := arg["mk"].(string)
boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink2(id, keyword, mentionKeyword)
sortArg := arg["sort"]
sort := util.SortModeUpdatedDESC
if nil != sortArg {
sort = int(sortArg.(float64))
}
mentionSortArg := arg["msort"]
mentionSort := util.SortModeUpdatedDESC
if nil != mentionSortArg {
sort = int(mentionSortArg.(float64))
}
boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink2(id, keyword, mentionKeyword, sort, mentionSort)
ret.Data = map[string]interface{}{
"backlinks": backlinks,
"linkRefsCount": linkRefsCount,