mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🧑💻 Add a parameter containChildren for the kernel API /api/ref/getBacklinkDoc
接口 `/api/ref/getBacklinkDoc` 和 `/api/ref/getBackmentionDoc` 添加参数 `containChildren` 。 Co-authored-by: weizelong <1710010123@qq.com>
This commit is contained in:
parent
380cee6e10
commit
13140edd6b
4 changed files with 18 additions and 8 deletions
|
|
@ -51,7 +51,11 @@ func getBackmentionDoc(c *gin.Context) {
|
|||
defID := arg["defID"].(string)
|
||||
refTreeID := arg["refTreeID"].(string)
|
||||
keyword := arg["keyword"].(string)
|
||||
backlinks := model.GetBackmentionDoc(defID, refTreeID, keyword)
|
||||
containChildren := true
|
||||
if val, ok := arg["containChildren"]; ok {
|
||||
containChildren = val.(bool)
|
||||
}
|
||||
backlinks := model.GetBackmentionDoc(defID, refTreeID, keyword, containChildren)
|
||||
ret.Data = map[string]interface{}{
|
||||
"backmentions": backlinks,
|
||||
}
|
||||
|
|
@ -69,7 +73,11 @@ func getBacklinkDoc(c *gin.Context) {
|
|||
defID := arg["defID"].(string)
|
||||
refTreeID := arg["refTreeID"].(string)
|
||||
keyword := arg["keyword"].(string)
|
||||
backlinks := model.GetBacklinkDoc(defID, refTreeID, keyword)
|
||||
containChildren := true
|
||||
if val, ok := arg["containChildren"]; ok {
|
||||
containChildren = val.(bool)
|
||||
}
|
||||
backlinks := model.GetBacklinkDoc(defID, refTreeID, keyword, containChildren)
|
||||
ret.Data = map[string]interface{}{
|
||||
"backlinks": backlinks,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue