This commit is contained in:
Daniel 2024-12-05 10:11:07 +08:00
parent 4b3f95e4bf
commit c1fd34f57b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 32 additions and 14 deletions

View file

@ -56,7 +56,11 @@ func getBackmentionDoc(c *gin.Context) {
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
backlinks := model.GetBackmentionDoc(defID, refTreeID, keyword, containChildren)
highlight := true
if val, ok := arg["highlight"]; ok {
highlight = val.(bool)
}
backlinks := model.GetBackmentionDoc(defID, refTreeID, keyword, containChildren, highlight)
ret.Data = map[string]interface{}{
"backmentions": backlinks,
}
@ -78,7 +82,11 @@ func getBacklinkDoc(c *gin.Context) {
if val, ok := arg["containChildren"]; ok {
containChildren = val.(bool)
}
backlinks := model.GetBacklinkDoc(defID, refTreeID, keyword, containChildren)
highlight := true
if val, ok := arg["highlight"]; ok {
highlight = val.(bool)
}
backlinks := model.GetBacklinkDoc(defID, refTreeID, keyword, containChildren, highlight)
ret.Data = map[string]interface{}{
"backlinks": backlinks,
}