This commit is contained in:
Liang Ding 2022-10-01 16:01:34 +08:00
parent 66f27afcc2
commit fd01ab84e2
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 18 additions and 0 deletions

View file

@ -38,6 +38,23 @@ func refreshBacklink(c *gin.Context) {
model.RefreshBacklink(id)
}
func getBackmentionDoc(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
defID := arg["defID"].(string)
keyword := ""
backlinks := model.GetBackmentionDoc(defID, keyword)
ret.Data = map[string]interface{}{
"backmentions": backlinks,
}
}
func getBacklinkDoc(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

View file

@ -157,6 +157,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/ref/refreshBacklink", model.CheckAuth, refreshBacklink)
ginServer.Handle("POST", "/api/ref/getBacklink", model.CheckAuth, getBacklink)
ginServer.Handle("POST", "/api/ref/getBacklinkDoc", model.CheckAuth, getBacklinkDoc)
ginServer.Handle("POST", "/api/ref/getBackmentionDoc", model.CheckAuth, getBackmentionDoc)
ginServer.Handle("POST", "/api/ref/createBacklink", model.CheckAuth, model.CheckReadonly, createBacklink)
ginServer.Handle("POST", "/api/attr/getBookmarkLabels", model.CheckAuth, getBookmarkLabels)