mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 04:18:48 +01:00
🧑💻 API | getDocumentAssets https://github.com/siyuan-note/siyuan/issues/13875
This commit is contained in:
parent
4d92d63ba1
commit
693bf7e1ed
3 changed files with 30 additions and 0 deletions
|
|
@ -202,6 +202,25 @@ func getDocImageAssets(c *gin.Context) {
|
|||
ret.Data = assets
|
||||
}
|
||||
|
||||
func getDocAssets(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)
|
||||
assets, err := model.DocAssets(id)
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
ret.Data = assets
|
||||
}
|
||||
|
||||
func setFileAnnotation(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue