修改exportResources这个API的参数 (#10855)

* 修改exportResources这个API,使得能够同时识别path和paths参数

* 修改exportResources这个API的说明文档

* 设定exportResources这个API的paths参数是必须的

* 重新修改exportResources的参数示例

* 设定exportResources这个API的返回值为1
This commit is contained in:
小小飞同学 2024-04-03 23:23:57 +08:00 committed by GitHub
parent e6591d9e43
commit ffc8b41c50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -283,11 +283,16 @@ func exportResources(c *gin.Context) {
name = time.Now().Format("export-2006-01-02_15-04-05") // 生成的 *.zip 文件主文件名
}
if arg["paths"] == nil {
ret.Code = 1
ret.Data = ""
ret.Msg = "paths is required"
return
}
var resourcePaths []string // 文件/文件夹在工作空间中的路径
if nil != arg["paths"] {
for _, resourcePath := range arg["paths"].([]interface{}) {
resourcePaths = append(resourcePaths, resourcePath.(string))
}
for _, resourcePath := range arg["paths"].([]interface{}) {
resourcePaths = append(resourcePaths, resourcePath.(string))
}
zipFilePath, err := model.ExportResources(resourcePaths, name)