mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: create empty file in web panel (#305)
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,6 +445,8 @@ func InitMasterRouter() *gin.Engine {
|
||||
file.GET("upload/credential", controllers.GetUploadCredential)
|
||||
// 更新文件
|
||||
file.PUT("update/:id", controllers.PutContent)
|
||||
// 创建空白文件
|
||||
file.POST("create", controllers.CreateFile)
|
||||
// 创建文件下载会话
|
||||
file.PUT("download/:id", controllers.CreateDownloadSession)
|
||||
// 预览文件
|
||||
|
||||
Reference in New Issue
Block a user