2022-08-24 03:10:50 +00:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-17 08:32:31 +00:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-08-24 03:10:50 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type FileRouter struct {
|
|
|
|
}
|
|
|
|
|
2023-12-20 14:44:09 +00:00
|
|
|
func (f *FileRouter) InitRouter(Router *gin.RouterGroup) {
|
2022-08-24 03:10:50 +00:00
|
|
|
fileRouter := Router.Group("files")
|
2022-09-29 08:15:59 +00:00
|
|
|
fileRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-08-24 03:10:50 +00:00
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
fileRouter.POST("/search", baseApi.ListFiles)
|
2023-03-02 05:54:07 +00:00
|
|
|
fileRouter.POST("/upload/search", baseApi.SearchUploadWithPage)
|
2022-08-24 09:34:21 +00:00
|
|
|
fileRouter.POST("/tree", baseApi.GetFileTree)
|
2022-08-25 09:54:52 +00:00
|
|
|
fileRouter.POST("", baseApi.CreateFile)
|
2022-08-25 10:48:03 +00:00
|
|
|
fileRouter.POST("/del", baseApi.DeleteFile)
|
2022-12-01 02:36:49 +00:00
|
|
|
fileRouter.POST("/batch/del", baseApi.BatchDeleteFile)
|
2022-08-29 07:26:36 +00:00
|
|
|
fileRouter.POST("/mode", baseApi.ChangeFileMode)
|
2023-04-26 14:18:16 +00:00
|
|
|
fileRouter.POST("/owner", baseApi.ChangeFileOwner)
|
2022-08-30 09:59:59 +00:00
|
|
|
fileRouter.POST("/compress", baseApi.CompressFile)
|
2022-08-31 05:59:02 +00:00
|
|
|
fileRouter.POST("/decompress", baseApi.DeCompressFile)
|
2022-09-01 11:02:33 +00:00
|
|
|
fileRouter.POST("/content", baseApi.GetContent)
|
|
|
|
fileRouter.POST("/save", baseApi.SaveContent)
|
2023-03-08 07:33:43 +00:00
|
|
|
fileRouter.POST("/check", baseApi.CheckFile)
|
2023-03-12 03:40:21 +00:00
|
|
|
fileRouter.POST("/upload", baseApi.UploadFiles)
|
|
|
|
fileRouter.POST("/chunkupload", baseApi.UploadChunkFiles)
|
2022-09-06 09:48:49 +00:00
|
|
|
fileRouter.POST("/rename", baseApi.ChangeFileName)
|
|
|
|
fileRouter.POST("/wget", baseApi.WgetFile)
|
|
|
|
fileRouter.POST("/move", baseApi.MoveFile)
|
2023-05-29 16:00:56 +00:00
|
|
|
fileRouter.GET("/download", baseApi.Download)
|
|
|
|
fileRouter.POST("/chunkdownload", baseApi.DownloadChunkFiles)
|
2022-09-09 10:10:41 +00:00
|
|
|
fileRouter.POST("/size", baseApi.Size)
|
2022-09-14 11:09:39 +00:00
|
|
|
fileRouter.GET("/ws", baseApi.Ws)
|
|
|
|
fileRouter.GET("/keys", baseApi.Keys)
|
2023-11-01 10:30:56 +00:00
|
|
|
fileRouter.POST("/read", baseApi.ReadFileByLine)
|
2023-11-02 10:38:50 +00:00
|
|
|
fileRouter.POST("/batch/role", baseApi.BatchChangeModeAndOwner)
|
2023-10-18 09:02:24 +00:00
|
|
|
|
|
|
|
fileRouter.POST("/recycle/search", baseApi.SearchRecycleBinFile)
|
|
|
|
fileRouter.POST("/recycle/reduce", baseApi.ReduceRecycleBinFile)
|
|
|
|
fileRouter.POST("/recycle/clear", baseApi.ClearRecycleBinFile)
|
2023-12-04 06:56:09 +00:00
|
|
|
fileRouter.GET("/recycle/status", baseApi.GetRecycleStatus)
|
2023-10-20 09:56:46 +00:00
|
|
|
|
|
|
|
fileRouter.POST("/favorite/search", baseApi.SearchFavorite)
|
|
|
|
fileRouter.POST("/favorite", baseApi.CreateFavorite)
|
|
|
|
fileRouter.POST("/favorite/del", baseApi.DeleteFavorite)
|
|
|
|
|
2022-08-24 03:10:50 +00:00
|
|
|
}
|
|
|
|
}
|