1Panel/backend/router/ro_file.go

51 lines
1.9 KiB
Go
Raw Normal View History

2022-08-24 11:10:50 +08:00
package router
import (
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
"github.com/1Panel-dev/1Panel/backend/middleware"
2022-08-24 11:10:50 +08:00
"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()).Use(middleware.PasswordExpired())
2022-08-24 11:10:50 +08:00
baseApi := v1.ApiGroupApp.BaseApi
{
fileRouter.POST("/search", baseApi.ListFiles)
2023-03-02 13:54:07 +08:00
fileRouter.POST("/upload/search", baseApi.SearchUploadWithPage)
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-12-01 10:36:49 +08:00
fileRouter.POST("/batch/del", baseApi.BatchDeleteFile)
fileRouter.POST("/mode", baseApi.ChangeFileMode)
fileRouter.POST("/owner", baseApi.ChangeFileOwner)
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)
2023-03-08 15:33:43 +08:00
fileRouter.POST("/check", baseApi.CheckFile)
2023-03-12 11:40:21 +08:00
fileRouter.POST("/upload", baseApi.UploadFiles)
fileRouter.POST("/chunkupload", baseApi.UploadChunkFiles)
2022-09-06 17:48:49 +08:00
fileRouter.POST("/rename", baseApi.ChangeFileName)
fileRouter.POST("/wget", baseApi.WgetFile)
fileRouter.POST("/move", baseApi.MoveFile)
fileRouter.GET("/download", baseApi.Download)
fileRouter.POST("/chunkdownload", baseApi.DownloadChunkFiles)
fileRouter.POST("/size", baseApi.Size)
2022-09-14 19:09:39 +08:00
fileRouter.GET("/ws", baseApi.Ws)
fileRouter.GET("/keys", baseApi.Keys)
fileRouter.POST("/recycle/search", baseApi.SearchRecycleBinFile)
fileRouter.POST("/recycle/reduce", baseApi.ReduceRecycleBinFile)
fileRouter.POST("/recycle/clear", baseApi.ClearRecycleBinFile)
fileRouter.POST("/favorite/search", baseApi.SearchFavorite)
fileRouter.POST("/favorite", baseApi.CreateFavorite)
fileRouter.POST("/favorite/del", baseApi.DeleteFavorite)
2022-08-24 11:10:50 +08:00
}
}