mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🧑💻 Add a kernel API /api/filetree/getPathByID
* 🧑💻 Add a new api '/api/filetree/getPathByID' * 🧑💻 Add a new api '/api/filetree/getPathByID'
This commit is contained in:
parent
b062d3f45f
commit
593e3141ab
5 changed files with 76 additions and 0 deletions
|
|
@ -364,6 +364,29 @@ func getHPathByID(c *gin.Context) {
|
|||
ret.Data = hPath
|
||||
}
|
||||
|
||||
func getPathByID(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
if util.InvalidIDPattern(id, ret) {
|
||||
return
|
||||
}
|
||||
|
||||
_path, err := model.GetPathByID(id)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
ret.Data = _path
|
||||
}
|
||||
|
||||
func getFullHPathByID(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue