dev_gateway.go 994 B

1234567891011121314151617181920212223242526272829
  1. package devices
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "server/api/v1"
  5. "server/middleware"
  6. )
  7. type GateWayRouter struct{}
  8. func (g *GateWayRouter) InitGateWayRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
  9. gatewayRouter := Router.Group("gateway").Use(middleware.OperationRecord())
  10. gatewayRouterWithoutRecord := Router.Group("gateway")
  11. apiPublicRouterWithoutRecord := RouterPub.Group("gateway")
  12. baseApi := v1.ApiGroupApp.DevicesApiGroup.GateWayApi
  13. {
  14. gatewayRouter.POST("addGateway", baseApi.AddGateway) // 增加网关
  15. gatewayRouter.POST("updateGateway", baseApi.UpdateGateway) // 编辑网关
  16. gatewayRouter.DELETE("delGateway", baseApi.DelGateway) // 删除网关
  17. }
  18. {
  19. gatewayRouterWithoutRecord.POST("getGateWayList", baseApi.GateWayList) // 分页获取网关列表
  20. //gatewayRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
  21. }
  22. {
  23. apiPublicRouterWithoutRecord.GET("getPublicGateway", baseApi.PublicGateway)
  24. }
  25. }