package example

import (
	handler "kra/internal/server/handler/example"
	"kra/internal/server/middleware"

	"github.com/gin-gonic/gin"
)

type FileUploadRouter struct{}

func (r *FileUploadRouter) InitFileUploadRouter(Router *gin.RouterGroup) {
	fileUploadRouter := Router.Group("fileUploadAndDownload").Use(middleware.OperationRecordMiddleware())
	fileUploadRouterWithoutRecord := Router.Group("fileUploadAndDownload")
	var api handler.FileUploadApi
	{
		fileUploadRouter.POST("upload", api.UploadFile)
		fileUploadRouter.POST("deleteFile", api.DeleteFile)
		fileUploadRouter.POST("editFileName", api.EditFileName)
		fileUploadRouter.POST("importURL", api.ImportURL)
		// 断点续传
		fileUploadRouter.POST("breakpointContinue", api.BreakpointContinue)
		fileUploadRouter.POST("breakpointContinueFinish", api.BreakpointContinueFinish)
		fileUploadRouter.POST("removeChunk", api.RemoveChunk)
	}
	{
		fileUploadRouterWithoutRecord.POST("getFileList", api.GetFileList)
		fileUploadRouterWithoutRecord.GET("findFile", api.FindFile)
	}
}
