package admin

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

type ProjectRouter struct{}

func (s *ProjectRouter) InitProjectRouter(Router *gin.RouterGroup) {
	projectRouter := Router.Group("project").Use(middleware.OperationRecord())
	projectRouterWithoutRecord := Router.Group("project")
	projectApi := v1.ApiGroupApp.AdminApiGroup.ProjectApi
	{
		projectRouter.POST("createProject", projectApi.CreateProject)
		projectRouter.POST("createProjectFile", projectApi.CreateProjectFile)
		projectRouter.POST("createWorkingHours", projectApi.CreateWorkingHours)
		projectRouter.POST("createCollection", projectApi.CreateCollection)
		projectRouter.POST("createReimbursement", projectApi.CreateReimbursement)
		projectRouter.POST("createProjectState", projectApi.CreateProjectState)

		projectRouter.PUT("updateProject", projectApi.UpdateProject)
		projectRouter.PUT("updateWorkingHours", projectApi.UpdateWorkingHours)
		projectRouter.PUT("updateCollection", projectApi.UpdateCollection)
		projectRouter.PUT("updateReimbursement", projectApi.UpdateReimbursement)
		projectRouter.PUT("updateProjectState", projectApi.UpdateProjectState)

		projectRouter.DELETE("deleteProject", projectApi.DeleteProject)
		projectRouter.DELETE("deleteProjectFile", projectApi.DeleteProjectFile)
		projectRouter.DELETE("deleteProjectFiles", projectApi.DeleteProjectFiles)
		projectRouter.DELETE("deleteWorkingHours", projectApi.DeleteWorkingHours)
		projectRouter.DELETE("deleteCollection", projectApi.DeleteCollection)
		projectRouter.DELETE("deleteReimbursement", projectApi.DeleteReimbursement)
		projectRouter.DELETE("deleteProjectState", projectApi.DeleteProjectState)
	}
	{
		projectRouterWithoutRecord.POST("queryProjectList", projectApi.QueryProjectList)
		projectRouterWithoutRecord.GET("queryProjectByCode", projectApi.QueryProjectByCode)
		projectRouterWithoutRecord.POST("queryFileList", projectApi.QueryFileList)
		projectRouterWithoutRecord.GET("queryAllProject", projectApi.QueryAllProject)
		projectRouterWithoutRecord.GET("queryProjectsInfo", projectApi.QueryProjectsInfo)
		projectRouterWithoutRecord.GET("queryWorkingHours", projectApi.QueryWorkingHours)
		projectRouterWithoutRecord.GET("queryCollection", projectApi.QueryCollections)
		projectRouterWithoutRecord.POST("queryWorkingHoursList", projectApi.QueryWorkingHoursList)
		projectRouterWithoutRecord.POST("queryWorkingHoursSum", projectApi.QueryWorkingHoursSum)
		projectRouterWithoutRecord.POST("queryCollectionList", projectApi.QueryCollectionList)
		projectRouterWithoutRecord.POST("queryReimbursementList", projectApi.QueryReimbursementList)
		projectRouterWithoutRecord.GET("queryReimbursement", projectApi.QueryReimbursement)
		projectRouterWithoutRecord.POST("projectFilesDownload", projectApi.ProjectFilesDownload)
		projectRouterWithoutRecord.GET("queryProjectState", projectApi.QueryProjectState)
		projectRouterWithoutRecord.GET("queryProjectSum", projectApi.QueryProjectSum)
	}
}
