mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
6588af2f32
commit
1c48345150
3 changed files with 42 additions and 0 deletions
|
|
@ -406,6 +406,38 @@ func uploadCloud(c *gin.Context) {
|
|||
util.PushMsg(fmt.Sprintf(model.Conf.Language(41), count), 3000)
|
||||
}
|
||||
|
||||
func uploadCloudByAssetsPaths(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
if nil == arg["paths"] {
|
||||
ret.Code = -1
|
||||
ret.Msg = "paths is required"
|
||||
return
|
||||
}
|
||||
|
||||
pathsArg := arg["paths"].([]interface{})
|
||||
var assets []string
|
||||
for _, pathArg := range pathsArg {
|
||||
assets = append(assets, pathArg.(string))
|
||||
}
|
||||
|
||||
count, err := model.UploadAssets2CloudByAssetsPaths(assets)
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 3000}
|
||||
return
|
||||
}
|
||||
|
||||
util.PushMsg(fmt.Sprintf(model.Conf.Language(41), count), 3000)
|
||||
}
|
||||
|
||||
func insertLocalAssets(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue