package admin

import (
	"github.com/gin-gonic/gin"
	v1 "server/api/v1"
	"server/middleware"
)

type FileRouter struct{}

func (s *ProjectRouter) InitFileRouter(Router *gin.RouterGroup) {
	fileRouter := Router.Group("file").Use(middleware.OperationRecord())
	fileRouterWithoutRecord := Router.Group("file")
	fileApi := v1.ApiGroupApp.AdminApiGroup.FileApi
	{
		fileRouter.POST("createFileGenre", fileApi.CreateFileGenre)
		fileRouter.POST("createNecessaryDocument", fileApi.CreateNecessaryDocument)
		fileRouter.PUT("updateFileGenre", fileApi.UpdateFileGenre)
		fileRouter.PUT("updateNecessaryDocument", fileApi.UpdateNecessaryDocument)
		fileRouter.DELETE("deleteFileGenre", fileApi.DeleteFileGenre)
		fileRouter.DELETE("deleteNecessaryDocument", fileApi.DeleteNecessaryDocument)
	}
	{
		fileRouterWithoutRecord.GET("queryFileGenre", fileApi.QueryFileGenre)
		fileRouterWithoutRecord.GET("queryNecessaryDocuments", fileApi.QueryNecessaryDocuments)
		fileRouterWithoutRecord.GET("queryNecessaryDocumentByGenreId", fileApi.QueryNecessaryDocumentByGenreId)
		fileRouterWithoutRecord.GET("fileDownload", fileApi.FileDownload)
	}
}
