gateway.go 735 B

12345678910111213141516171819202122
  1. package app
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lc-fangdaosha/api/v1"
  5. )
  6. type GatewayRouter struct {
  7. }
  8. // InitGatewayRouter 初始化网关路由信息
  9. func (s *GatewayRouter) InitGatewayRouter(Router *gin.RouterGroup) {
  10. var gwApi = v1.ApiGroupApp.AppApiGroup.GatewayApi
  11. gwGroup := Router.Group("gateways")
  12. {
  13. gwGroup.GET("all", gwApi.List) //获取网关列表
  14. gwGroup.PUT("adminSet", gwApi.AdminSet) //管理员设置osn和给网关分配用户
  15. gwGroup.PUT("userSet", gwApi.UserSet) //用户设置网关名和描述信息
  16. gwGroup.DELETE("delete", gwApi.DeleteGateways) //删除网关及其关联设备
  17. gwGroup.PUT("unbind", gwApi.UnbindGateways) //解绑网关下的设备
  18. }
  19. }