mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: task queue / compression task
This commit is contained in:
@@ -47,6 +47,17 @@ func Archive(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Compress 创建文件压缩任务
|
||||
func Compress(c *gin.Context) {
|
||||
var service explorer.ItemCompressService
|
||||
if err := c.ShouldBindJSON(&service); err == nil {
|
||||
res := service.CreateCompressTask(c)
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
// AnonymousGetContent 匿名获取文件资源
|
||||
func AnonymousGetContent(c *gin.Context) {
|
||||
// 创建上下文
|
||||
|
||||
@@ -267,6 +267,8 @@ func InitMasterRouter() *gin.Engine {
|
||||
file.GET("source/:id", controllers.GetSource)
|
||||
// 打包要下载的文件
|
||||
file.POST("archive", controllers.Archive)
|
||||
// 创建文件压缩任务
|
||||
file.POST("compress", controllers.Compress)
|
||||
}
|
||||
|
||||
// 目录
|
||||
|
||||
Reference in New Issue
Block a user