Feat: API for getting object property

This commit is contained in:
HFO4
2021-03-11 14:50:02 +08:00
parent a93b964d8b
commit 1f1bc056e3
8 changed files with 201 additions and 1 deletions

View File

@@ -66,3 +66,19 @@ func Rename(c *gin.Context) {
c.JSON(200, ErrorResponse(err))
}
}
// Rename 重命名文件或目录
func GetProperty(c *gin.Context) {
// 创建上下文
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
var service explorer.ItemPropertyService
service.ID = c.Param("id")
if err := c.ShouldBindQuery(&service); err == nil {
res := service.GetProperty(ctx, c)
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}

View File

@@ -510,6 +510,8 @@ func InitMasterRouter() *gin.Engine {
object.POST("copy", controllers.Copy)
// 重命名对象
object.POST("rename", controllers.Rename)
// 获取对象属性
object.GET("property/:id", controllers.GetProperty)
}
// 分享