package devices

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

type IntersectRouter struct{}

func (i *IntersectRouter) InitIntersectRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
	intersectRouter := Router.Group("intersect").Use(middleware.OperationRecord())
	intersectRouterWithoutRecord := Router.Group("intersect")

	apiPublicRouterWithoutRecord := RouterPub.Group("intersect")
	baseApi := v1.ApiGroupApp.DevicesApiGroup.IntersectApi
	{
		intersectRouter.POST("addIntersect", baseApi.AddIntersect)      // 增加路口
		intersectRouter.PUT("updateIntersect", baseApi.UpdateIntersect) // 编辑路口
		intersectRouter.DELETE("delIntersect", baseApi.DelIntersect)    // 删除路口
	}
	{
		intersectRouterWithoutRecord.POST("getIntersectList", baseApi.IntersectList) // 分页获取路口列表
	}
	{
		apiPublicRouterWithoutRecord.GET("getPublicIntersect", baseApi.PublicIntersect)
	}
}
