package project

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

type ProjectRouter struct{}

func (p *ProjectRouter) InitProjectRouter(Router *gin.RouterGroup) {
	projectRouter := Router.Group("project").Use(middleware.OperationRecord())
	projectRouterWithoutRecord := Router.Group("project")

	baseApi := v1.ApiGroupApp.ProjectApiGroup.ProjectApi
	{
		projectRouter.POST("addProject", baseApi.AddProject)      // 增加项目
		projectRouter.PUT("updateProject", baseApi.UpdateProject) // 编辑项目
		projectRouter.DELETE("delProject", baseApi.DelProject)    // 删除项目

		projectRouter.PUT("changeProjects", baseApi.ChangeProjects) // 修改用户归属项目
	}
	{
		projectRouterWithoutRecord.POST("getProjectAndDetails", baseApi.GetProjectAndDetails)    //获取项目列表和设备详情
		projectRouterWithoutRecord.GET("getProjectList", baseApi.GetProjectList)                 //获取项目列表
		projectRouterWithoutRecord.GET("getProjectListByUserID", baseApi.GetProjectListByUserID) //获取项目列表根据用户id
	}
}
