package devices

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

type GateWayRouter struct{}

func (g *GateWayRouter) InitGateWayRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
	gatewayRouter := Router.Group("gateway").Use(middleware.OperationRecord())
	gatewayRouterWithoutRecord := Router.Group("gateway")

	apiPublicRouterWithoutRecord := RouterPub.Group("gateway")
	baseApi := v1.ApiGroupApp.DevicesApiGroup.GateWayApi
	{
		gatewayRouter.POST("addGateway", baseApi.AddGateway)       // 增加网关
		gatewayRouter.POST("updateGateway", baseApi.UpdateGateway) // 编辑网关
		gatewayRouter.DELETE("delGateway", baseApi.DelGateway)     // 删除网关
	}
	{
		gatewayRouterWithoutRecord.POST("getGateWayList", baseApi.GateWayList) // 分页获取网关列表
		//gatewayRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo)  // 获取自身信息
	}
	{
		apiPublicRouterWithoutRecord.GET("getPublicGateway", baseApi.PublicGateway)
	}
}
