Feat: decompression task

This commit is contained in:
HFO4
2020-02-03 13:23:33 +08:00
parent e722c33cd5
commit 91e202c7e6
19 changed files with 440 additions and 52 deletions

View File

@@ -58,6 +58,17 @@ func Compress(c *gin.Context) {
}
}
// Decompress 创建文件解压缩任务
func Decompress(c *gin.Context) {
var service explorer.ItemDecompressService
if err := c.ShouldBindJSON(&service); err == nil {
res := service.CreateDecompressTask(c)
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}
// AnonymousGetContent 匿名获取文件资源
func AnonymousGetContent(c *gin.Context) {
// 创建上下文

View File

@@ -269,6 +269,8 @@ func InitMasterRouter() *gin.Engine {
file.POST("archive", controllers.Archive)
// 创建文件压缩任务
file.POST("compress", controllers.Compress)
// 创建文件解压缩任务
file.POST("decompress", controllers.Decompress)
}
// 目录