2022-08-24 11:10:50 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
v1 "github.com/1Panel-dev/1Panel/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/middleware"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type FileRouter struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *FileRouter) InitFileRouter(Router *gin.RouterGroup) {
|
|
|
|
fileRouter := Router.Group("files")
|
|
|
|
fileRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
|
|
|
//withRecordRouter := fileRouter.Use(middleware.OperationRecord())
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
fileRouter.POST("/search", baseApi.ListFiles)
|
2022-08-24 17:34:21 +08:00
|
|
|
fileRouter.POST("/tree", baseApi.GetFileTree)
|
2022-08-25 17:54:52 +08:00
|
|
|
fileRouter.POST("", baseApi.CreateFile)
|
2022-08-25 18:48:03 +08:00
|
|
|
fileRouter.POST("/del", baseApi.DeleteFile)
|
2022-08-29 15:26:36 +08:00
|
|
|
fileRouter.POST("/mode", baseApi.ChangeFileMode)
|
2022-08-30 17:59:59 +08:00
|
|
|
fileRouter.POST("/compress", baseApi.CompressFile)
|
2022-08-31 13:59:02 +08:00
|
|
|
fileRouter.POST("/decompress", baseApi.DeCompressFile)
|
2022-09-01 19:02:33 +08:00
|
|
|
fileRouter.POST("/content", baseApi.GetContent)
|
|
|
|
fileRouter.POST("/save", baseApi.SaveContent)
|
2022-09-03 18:41:52 +08:00
|
|
|
fileRouter.POST("/upload", baseApi.UploadFiles)
|
2022-09-06 17:48:49 +08:00
|
|
|
fileRouter.POST("/rename", baseApi.ChangeFileName)
|
|
|
|
fileRouter.POST("/wget", baseApi.WgetFile)
|
|
|
|
fileRouter.POST("/move", baseApi.MoveFile)
|
2022-09-05 16:25:26 +08:00
|
|
|
fileRouter.POST("/download", baseApi.Download)
|
2022-09-09 18:10:41 +08:00
|
|
|
fileRouter.POST("/size", baseApi.Size)
|
2022-08-24 11:10:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|