Feat: create empty file in web panel (#305)

This commit is contained in:
HFO4
2020-05-09 10:35:18 +08:00
parent ee0f224cbb
commit 58856612e2
4 changed files with 51 additions and 2 deletions

View File

@@ -353,3 +353,14 @@ func SearchFile(c *gin.Context) {
c.JSON(200, ErrorResponse(err))
}
}
// CreateFile 创建空白文件
func CreateFile(c *gin.Context) {
var service explorer.SingleFileService
if err := c.ShouldBindJSON(&service); err == nil {
res := service.Create(c)
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}