소스 검색

init controller

terry 2 년 전
부모
커밋
60071b72fb
6개의 변경된 파일400개의 추가작업 그리고 38개의 파일을 삭제
  1. 27 2
      app/controller/cameraController.go
  2. 43 24
      app/dao/cameraDto.go
  3. 6 6
      app/dao/common.go
  4. 6 6
      app/service/cameraService.go
  5. 41 0
      app/utils/errors.go
  6. 277 0
      router/router.go

+ 27 - 2
app/controller/cameraController.go

@@ -4,10 +4,11 @@ import (
 	"github.com/gin-gonic/gin"
 	"iot_manager_service/app/model"
 	"iot_manager_service/app/service"
+	"iot_manager_service/app/utils"
 	"net/http"
 )
 
-// 控制器管理对象
+// 摄像头管理对象
 var Camera = new(cameraCtl)
 
 type cameraCtl struct{}
@@ -20,11 +21,14 @@ func (c *cameraCtl) Detail(ctx *gin.Context) {
 	}
 }
 
+func (c *cameraCtl) List(ctx *gin.Context) {
+}
+
 func (c *cameraCtl) CreateOrUpdate(ctx *gin.Context) {
 	// 参数验证
 	var req *model.ReqCamera
 	if err := ctx.ShouldBind(&req); err != nil {
-		ctx.JSON(http.StatusOK, nil)
+		ctx.JSON(http.StatusOK, utils.ParamsInvalidResponse(err.Error(), nil))
 		return
 	}
 	err := service.CameraService.CreateOrUpdate(req)
@@ -33,3 +37,24 @@ func (c *cameraCtl) CreateOrUpdate(ctx *gin.Context) {
 		return
 	}
 }
+
+func (c *cameraCtl) Remove(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) Count(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) ImportExcel(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) ExportExcel(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) ExportTemplate(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) GetList(ctx *gin.Context) {
+}
+
+func (c *cameraCtl) Enable(ctx *gin.Context) {
+}

+ 43 - 24
app/dao/cameraDto.go

@@ -1,37 +1,51 @@
 package dao
 
-//网关下挂载的设备串口设备,如485接口的设备,数据来自设备上报
+import "time"
+
+//CameraDevice 网关下挂载的设备, 摄像头
 type CameraDevice struct {
-	ID         string `gorm:"type:varchar(32);primary_key"` //设备ID,DID
-	Name       string `gorm:"type:varchar(64)"`             //设备名称
-	GID        string `gorm:"type:varchar(32)"`             //网关ID
-	IP         string `gorm:"type:varchar(40)"`             //ip
-	SN         string `gorm:"type:varchar(64)"`             //设备序列号
-	Brand      string `gorm:"type:varchar(24)"`             //设备品牌
-	Model      string `gorm:"type:varchar(32)"`             //设备型号
-	DevType    int    `gorm:"type:int"`                     //3摄象机,4一键报警(带视频)
-	User       string `gorm:"type:varchar(32)"`             //onvif用户名
-	Password   string `gorm:"type:varchar(64)"`             //onvif密码
-	RtmpServer string `gorm:"type:varchar(256)"`            //流地址
-	WebServer  string `gorm:"type:varchar(256)"`            //web地址
-	Event      string `gorm:"type:varchar(128)"`            //需要订阅的事件主题
-	Gb28181    bool   `gorm:"type:bool"`                    //国标28181,是否已开启GB28181
-	Tenant     string `gorm:"type:varchar(8)"`              //租户ID
-	State      int    `gorm:"type:int"`                     //1启用,0禁用
-	LcModel
+	ID               string    `gorm:"type:int;comment '编号';primary_key"`
+	Name             string    `gorm:"type:varchar(64);comment '设备名称'"`
+	GatewayId        string    `gorm:"type:varchar(32);comment '所属网关'"`
+	IP               string    `gorm:"type:varchar(40);null;comment 'IP地址'"`
+	SN               string    `gorm:"type:varchar(64);comment '设备序列号'"`
+	CameraType       int       `gorm:"type:int;null;comment '摄像机类型 0=枪机,1=球机'"`
+	Brand            int       `gorm:"type:int;null; comment '设备品牌'"`
+	Model            int       `gorm:"type:int;null; comment '设备型号'"`
+	GroupId          int       `gorm:"type:int;null;comment '灯杆分组ID'"`
+	LampPoleId       int       `gorm:"type:int;null;comment '归属灯杆 灯杆ID'"`
+	LampPoleName     string    `gorm:"type:varchar(64);null;comment '灯杆名称'"`
+	LampPoleSn       string    `gorm:"type:varchar(64);null;comment '灯杆sn'"`
+	LampPoleLocation string    `gorm:"type:varchar(255);null;comment '灯杆安装位置'"`
+	LampLat          float64   `gorm:"type:double(17,14);null; comment '经度'"`
+	LampLng          float64   `gorm:"type:double(17,14) null; comment '纬度'"`
+	RatedPower       float32   `gorm:"type:float(8,2) null; comment '功率'"`
+	MonitorAddress   string    `gorm:"type:varchar(255);null;comment '监控地址 ip:端口'"`
+	DevType          int       `gorm:"type:int;null;comment '3摄像机'"`
+	Tenant           string    `gorm:"type:varchar(8);null;comment '租户ID"`
+	InstallTime      time.Time `gorm:"type:date;null;comment '安装时间'"`
+	CreateTime       time.Time `gorm:"type:datetime;null;comment '新增时间'"`
+	CreateUser       string    `gorm:"type:varchar(60);null;comment '新增记录操作用户ID'"`
+	UpdateTime       time.Time `gorm:"type:datetime;null;comment '修改时间'"`
+	UpdateUser       string    `gorm:"type:varchar(60)"`   //修改用户
+	IsDeleted        int       `gorm:"type:int"`           //是否删除 0=未删除,1=删除
+	Status           int       `gorm:"type:int"`           //状态 0=正常,1=异常
+	Tag              string    `gorm:"type:varchar(255)"`  //标签,(备用,逗号区分)
+	IsEnable         int       `gorm:"type:int;default 2"` // 启用禁用:1启用,2禁用
+	StreamId         string    `gorm:"type:varchar(100)"`  // 流id
 }
 
 func (CameraDevice) TableName() string {
-	return "t_device_camera"
+	return "t_dev_camera"
 }
 
 func (c CameraDevice) Delete() error {
-	return G_db.Model(&c).Updates(map[string]interface{}{"state": 0}).Error
+	return GDb.Model(&c).Updates(map[string]interface{}{"state": 0}).Error
 }
 
 func (c CameraDevice) IsExistedByCode() (bool, error) {
 	var count = 0
-	err := G_db.Model(&c).Where(" id = ? ", c.ID).Count(&count).Error
+	err := GDb.Model(&c).Where(" id = ? ", c.ID).Count(&count).Error
 	return count > 0, err
 }
 
@@ -41,9 +55,14 @@ func (c CameraDevice) SaveFromWeb() error {
 		return err
 	}
 	if has { //更新
-		return G_db.Model(&c).Updates(map[string]interface{}{"name": c.Name, "g_id": c.GID,
-			"dev_type": c.DevType, "tenant": c.Tenant, "state": c.State}).Error
+		return GDb.Model(&c).Updates(map[string]interface{}{"name": c.Name, "gateway_id": c.GatewayId,
+			"dev_type": c.DevType, "tenant": c.Tenant, "state": c.Status}).Error
 	} else { //插入
-		return G_db.Create(&c).Error
+		return GDb.Create(&c).Error
 	}
 }
+
+func (c CameraDevice) GetCameraDevice() error {
+	err := GDb.Model(&c).Where(" id = ? ", c.ID).Scan(&c).Error
+	return err
+}

+ 6 - 6
app/dao/common.go

@@ -8,7 +8,7 @@ import (
 	"time"
 )
 
-var G_db *gorm.DB
+var GDb *gorm.DB
 
 type LcModel struct {
 	CreatedAt time.Time
@@ -23,10 +23,10 @@ func InitDB() {
 	if err != nil {
 		panic(err)
 	} else {
-		G_db = db0
-		G_db.DB().SetMaxOpenConns(32)
-		G_db.DB().SetMaxIdleConns(5)
-		G_db.LogMode(false)
-		G_db.AutoMigrate(&CameraDevice{})
+		GDb = db0
+		GDb.DB().SetMaxOpenConns(32)
+		GDb.DB().SetMaxIdleConns(5)
+		GDb.LogMode(false)
+		GDb.AutoMigrate(&CameraDevice{})
 	}
 }

+ 6 - 6
app/service/cameraService.go

@@ -13,12 +13,12 @@ type cameraService struct{}
 func (s *cameraService) CreateOrUpdate(req *model.ReqCamera) error {
 	// 创建查询实例
 	device := dao.CameraDevice{
-		ID:      req.Code, //设备ID,DID
-		Name:    req.Name, //集控器名称
-		GID:     req.GID,  //网关ID
-		DevType: req.DevType,
-		Tenant:  req.Tenant,
-		State:   req.State, //1启用,0禁用
+		ID:        req.Code, //设备ID,DID
+		Name:      req.Name, //集控器名称
+		GatewayId: req.GID,  //网关ID
+		DevType:   req.DevType,
+		Tenant:    req.Tenant,
+		Status:    req.State, //1启用,0禁用
 	}
 	if err := device.SaveFromWeb(); err != nil {
 		return err

+ 41 - 0
app/utils/errors.go

@@ -0,0 +1,41 @@
+package utils
+
+type Errors struct {
+	Code int         `json:"code"`
+	Msg  string      `json:"msg"`
+	Data interface{} `json:"data"`
+}
+
+const (
+	CodeSucceed       = 0
+	CodeParamsInvalid = 10001
+)
+
+const (
+	Succeeded = "操作成功"
+	Failed    = "操作失败"
+)
+
+func SuccessResponse(data interface{}) *Errors {
+	return &Errors{
+		Code: CodeSucceed,
+		Msg:  Succeeded,
+		Data: data,
+	}
+}
+
+func FailResponse(data interface{}) *Errors {
+	return &Errors{
+		Code: CodeSucceed,
+		Msg:  Failed,
+		Data: data,
+	}
+}
+
+func ParamsInvalidResponse(msg string, data interface{}) *Errors {
+	return &Errors{
+		Code: CodeParamsInvalid,
+		Msg:  msg,
+		Data: data,
+	}
+}

+ 277 - 0
router/router.go

@@ -16,9 +16,286 @@ func InitRouter(engine *gin.Engine) {
 
 	// 设备管理
 	device := engine.Group("/api/longchi/device")
+
+	//桥梁
+	bridge := device.Group("bridge")
+	{
+		bridge.GET("/detail", controller.Bridge.Detail)
+		bridge.GET("/list", controller.Bridge.List)
+		bridge.POST("/submit", controller.Bridge.CreateOrUpdate)
+		bridge.POST("/remove", controller.Bridge.Remove)
+		bridge.GET("/dropdown", controller.Bridge.GetList)
+		bridge.POST("/import-excel", controller.Bridge.ImportExcel)
+		bridge.GET("/export-excel", controller.Bridge.ExportExcel)
+		bridge.GET("/export-template", controller.Bridge.ExportTemplate)
+	}
+
+	//桥梁传感器 控制器
+	bridgeSensor := device.Group("bridgesensor")
+	{
+		bridgeSensor.GET("/detail", controller.BridgeSensor.Detail)
+		bridgeSensor.GET("/list", controller.BridgeSensor.List)
+		bridgeSensor.POST("/submit", controller.BridgeSensor.CreateOrUpdate)
+		bridgeSensor.POST("/remove", controller.BridgeSensor.Remove)
+		bridgeSensor.GET("/dropdown", controller.BridgeSensor.GetList)
+		bridgeSensor.POST("/enable-disable", controller.BridgeSensor.Enable)
+		bridgeSensor.POST("/import-excel", controller.BridgeSensor.ImportExcel)
+		bridgeSensor.GET("/export-excel", controller.BridgeSensor.ExportExcel)
+		bridgeSensor.GET("/export-template", controller.BridgeSensor.ExportTemplate)
+	}
+
+	//摄像头
 	camera := device.Group("/camera")
 	{
 		camera.GET("/detail", controller.Camera.Detail)
+		camera.GET("/list", controller.Camera.List)
 		camera.POST("/submit", controller.Camera.CreateOrUpdate)
+		camera.POST("/remove", controller.Camera.Remove)
+		camera.POST("/import-excel", controller.Camera.ImportExcel)
+		camera.GET("/export-excel", controller.Camera.ExportExcel)
+		camera.GET("/export-template", controller.Camera.ExportTemplate)
+		camera.POST("/enable-disable", controller.Camera.Enable)
+		camera.GET("/getList", controller.Camera.GetList)
+	}
+
+	//抓拍单元+卡口 控制器
+	captureUnit := device.Group("captureunit")
+	{
+		captureUnit.GET("/detail", controller.CaptureUint.Detail)
+		captureUnit.GET("/capture-list", controller.CaptureUint.CaptureList)
+		captureUnit.POST("/capture-submit", controller.CaptureUint.CaptureSubmit)
+		captureUnit.GET("/capture-pull-down-list", controller.CaptureUint.CaptureGetList)
+		captureUnit.GET("/point-list", controller.CaptureUint.PointList)
+		captureUnit.POST("/point-submit", controller.CaptureUint.PointSubmit)
+		captureUnit.GET("/point-pull-down-list", controller.CaptureUint.PointGetList)
+		captureUnit.POST("/remove", controller.CaptureUint.Remove)
+	}
+
+	//垃圾桶台账 控制器
+	garbage := device.Group("garbage")
+	{
+		garbage.GET("/detail", controller.Garbage.Detail)
+		garbage.GET("/list", controller.Garbage.List)
+		garbage.POST("/submit", controller.Garbage.CreateOrUpdate)
+		garbage.POST("/remove", controller.Garbage.Remove)
+		garbage.GET("/dropdown", controller.Garbage.GetList)
+		garbage.POST("/import-excel", controller.Garbage.ImportExcel)
+		garbage.GET("/export-excel", controller.Garbage.ExportExcel)
+		garbage.GET("/export-template", controller.Garbage.ExportTemplate)
+	}
+
+	//垃圾桶道路分组管理 控制器
+	garbageWayGroup := device.Group("garbage-way-group")
+	{
+		garbageWayGroup.GET("/detail", controller.GarbageWay.Detail)
+		garbageWayGroup.GET("/list", controller.GarbageWay.List)
+		garbageWayGroup.POST("/submit", controller.GarbageWay.CreateOrUpdate)
+		garbageWayGroup.POST("/remove", controller.GarbageWay.Remove)
+		garbageWayGroup.GET("/getList", controller.GarbageWay.GetList)
+	}
+
+	//灯随车走灯杆关联分组 控制器
+	groupRelevanceLampPole := device.Group("group-relevance-lamppole")
+	{
+		groupRelevanceLampPole.GET("/detail", controller.GroupRelevanceLampPole.Detail)
+		groupRelevanceLampPole.GET("/list", controller.GroupRelevanceLampPole.List)
+		groupRelevanceLampPole.POST("/setting", controller.GroupRelevanceLampPole.Setting)
+		groupRelevanceLampPole.POST("/remove", controller.GroupRelevanceLampPole.Remove)
+	}
+
+	//信息屏基本信息 控制器
+	infoBoard := device.Group("infoboard")
+	{
+		infoBoard.GET("/detail", controller.InfoBoard.Detail)
+		infoBoard.GET("/list", controller.InfoBoard.List)
+		infoBoard.POST("/submit", controller.InfoBoard.CreateOrUpdate)
+		infoBoard.POST("/remove", controller.InfoBoard.Remove)
+		infoBoard.POST("/import-excel", controller.InfoBoard.ImportExcel)
+		infoBoard.GET("/export-excel", controller.InfoBoard.ExportExcel)
+		infoBoard.GET("/export-template", controller.InfoBoard.ExportTemplate)
+		infoBoard.GET("/system-operation", controller.InfoBoard.CreateOrUpdate)
+		infoBoard.POST("/enable-disable", controller.InfoBoard.Enable)
+		infoBoard.POST("/show-setting", controller.InfoBoard.ShowSetting)
+	}
+
+	//IP广播基本信息 控制器
+	ipBroadCast := device.Group("ipbroadcast")
+	{
+		ipBroadCast.GET("/detail", controller.IpBroadcast.Detail)
+		ipBroadCast.GET("/list", controller.IpBroadcast.List)
+		ipBroadCast.POST("/submit", controller.IpBroadcast.CreateOrUpdate)
+		ipBroadCast.POST("/remove", controller.IpBroadcast.Remove)
+		ipBroadCast.POST("/import-excel", controller.IpBroadcast.ImportExcel)
+		ipBroadCast.GET("/export-excel", controller.IpBroadcast.ExportExcel)
+		ipBroadCast.GET("/export-template", controller.IpBroadcast.ExportTemplate)
+		ipBroadCast.POST("/setting-volume", controller.IpBroadcast.SettingVolume)
+	}
+
+	//一键报警服务表 控制器
+	Alarm := device.Group("akeyalarmserve")
+	{
+		Alarm.GET("/detail", controller.Alarm.Detail)
+		Alarm.GET("/list", controller.Alarm.List)
+		Alarm.POST("/submit", controller.Alarm.CreateOrUpdate)
+		Alarm.POST("/remove", controller.Alarm.Remove)
+		Alarm.GET("/getList", controller.Alarm.GetList)
+		Alarm.POST("/import-excel", controller.Alarm.ImportExcel)
+		Alarm.GET("/export-excel", controller.Alarm.ExportExcel)
+		Alarm.GET("/export-template", controller.Alarm.ExportTemplate)
+	}
+
+	//一键报警终端表 控制器
+	AlarmTerminal := device.Group("akeyalarmterminal")
+	{
+		AlarmTerminal.GET("/detail", controller.AlarmTerminal.Detail)
+		AlarmTerminal.GET("/list", controller.AlarmTerminal.List)
+		AlarmTerminal.POST("/submit", controller.AlarmTerminal.CreateOrUpdate)
+		AlarmTerminal.POST("/remove", controller.AlarmTerminal.Remove)
+		AlarmTerminal.POST("/import-excel", controller.AlarmTerminal.ImportExcel)
+		AlarmTerminal.GET("/export-excel", controller.AlarmTerminal.ExportExcel)
+		AlarmTerminal.GET("/export-template", controller.AlarmTerminal.ExportTemplate)
+	}
+
+	//灯杆基本信息 控制器
+	lampPole := device.Group("lamppole")
+	{
+		lampPole.GET("/detail", controller.LampPole.Detail)
+		lampPole.GET("/getRelevanceDetail", controller.LampPole.GetRelevanceDetail)
+		lampPole.GET("/list", controller.LampPole.List)
+		lampPole.POST("/submit", controller.LampPole.CreateOrUpdate)
+		lampPole.POST("/remove", controller.LampPole.Remove)
+		lampPole.GET("/getList", controller.LampPole.GetList)
+		lampPole.POST("/import-excel", controller.LampPole.ImportExcel)
+		lampPole.GET("/export-excel", controller.LampPole.ExportExcel)
+		lampPole.GET("/export-template", controller.LampPole.ExportTemplate)
+	}
+
+	//灯杆分组
+	lampPoleGroup := device.Group("/lamppolegroup")
+	{
+		lampPoleGroup.GET("/detail", controller.LampPoleGroup.Detail)
+		lampPoleGroup.GET("/list", controller.LampPoleGroup.List)
+		lampPoleGroup.POST("/submit", controller.LampPoleGroup.CreateOrUpdate)
+		lampPoleGroup.POST("/remove", controller.LampPoleGroup.Remove)
+		lampPoleGroup.GET("/getList", controller.LampPoleGroup.GetList)
+		lampPoleGroup.GET("/filtration-list", controller.LampPoleGroup.FiltrationList)
+		lampPoleGroup.GET("/getTree", controller.LampPoleGroup.GetTree)
+	}
+
+	//灯控基本信息 控制器
+	lightControl := device.Group("lightcontrol")
+	{
+		lightControl.GET("/detail", controller.Light.Detail)
+		lightControl.GET("/list", controller.Light.List)
+		lightControl.POST("/submit", controller.Light.CreateOrUpdate)
+		lightControl.POST("/remove", controller.Light.Remove)
+		lightControl.GET("/getLampPoleList", controller.Light.GetList)
+		lightControl.POST("/import-excel", controller.Light.ImportExcel)
+		lightControl.GET("/export-excel", controller.Light.ExportExcel)
+		lightControl.GET("/export-template", controller.Light.ExportTemplate)
+		lightControl.POST("/enable-disable", controller.Light.Enable)
+		lightControl.POST("/off-one", controller.Light.Switch)
+	}
+
+	//井盖基本信息 控制器
+	manholeCover := device.Group("manholecover")
+	{
+		manholeCover.GET("/detail", controller.ManholeCover.Detail)
+		manholeCover.GET("/list", controller.ManholeCover.List)
+		manholeCover.POST("/submit", controller.ManholeCover.CreateOrUpdate)
+		manholeCover.POST("/remove", controller.ManholeCover.Remove)
+		manholeCover.POST("/setting", controller.ManholeCover.Setting)
+		manholeCover.GET("/getList", controller.ManholeCover.GetList)
+		manholeCover.POST("/import-excel", controller.ManholeCover.ImportExcel)
+		manholeCover.GET("/export-excel", controller.ManholeCover.ExportExcel)
+		manholeCover.GET("/export-template", controller.ManholeCover.ExportExcel)
+		manholeCover.GET("/all-list", controller.ManholeCover.AllList)
+	}
+
+	//灯随车走分组 控制器
+	onDemandGroup := device.Group("on-demand-group")
+	{
+		onDemandGroup.GET("/detail", controller.OnDemandGroup.Detail)
+		onDemandGroup.GET("/list", controller.OnDemandGroup.List)
+		onDemandGroup.POST("/submit", controller.OnDemandGroup.CreateOrUpdate)
+		onDemandGroup.POST("/remove", controller.OnDemandGroup.Remove)
+		onDemandGroup.GET("/getList", controller.OnDemandGroup.GetList)
+		onDemandGroup.GET("/group-number", controller.OnDemandGroup.Count)
+	}
+
+	//灯随车走传感器 控制器
+	onDemandSensor := device.Group("on-demand-sensor")
+	{
+		onDemandSensor.GET("/detail", controller.OnDemandSensor.Detail)
+		onDemandSensor.GET("/list", controller.OnDemandSensor.List)
+		onDemandSensor.POST("/submit", controller.OnDemandSensor.CreateOrUpdate)
+		onDemandSensor.POST("/remove", controller.OnDemandSensor.Remove)
+		onDemandSensor.POST("/import-excel", controller.OnDemandSensor.ImportExcel)
+		onDemandSensor.GET("/export-excel", controller.OnDemandSensor.ExportExcel)
+		onDemandSensor.GET("/export-template", controller.OnDemandSensor.ExportTemplate)
+	}
+
+	//环境传感器 控制器
+	optoSensor := device.Group("optosensor")
+	{
+		optoSensor.GET("/detail", controller.OptoSensor.Detail)
+		optoSensor.GET("/list", controller.OptoSensor.List)
+		optoSensor.POST("/submit", controller.OptoSensor.CreateOrUpdate)
+		optoSensor.POST("/remove", controller.OptoSensor.Remove)
+		optoSensor.GET("/getList", controller.OptoSensor.GetList)
+		optoSensor.POST("/set-default", controller.OptoSensor.SetDefault)
+		optoSensor.POST("/import-excel", controller.OptoSensor.ImportExcel)
+		optoSensor.GET("/export-excel", controller.OptoSensor.ExportExcel)
+		optoSensor.GET("/export-template", controller.OptoSensor.ExportTemplate)
+	}
+
+	//配电箱基本信息 控制器
+	switchBox := device.Group("switchbox")
+	{
+		switchBox.GET("/detail", controller.SwitchBox.Detail)
+		switchBox.GET("/list", controller.SwitchBox.List)
+		switchBox.POST("/submit", controller.SwitchBox.CreateOrUpdate)
+		switchBox.POST("/remove", controller.SwitchBox.Remove)
+		switchBox.GET("/getList", controller.SwitchBox.GetList)
+		switchBox.POST("/import-excel", controller.SwitchBox.ImportExcel)
+		switchBox.GET("/export-excel", controller.SwitchBox.ExportExcel)
+		switchBox.GET("/export-template", controller.SwitchBox.ExportTemplate)
+	}
+
+	//变压器基本信息 控制器
+	transformer := device.Group("transformer")
+	{
+		transformer.GET("/detail", controller.Transformer.Detail)
+		transformer.GET("/list", controller.Transformer.List)
+		transformer.POST("/submit", controller.Transformer.CreateOrUpdate)
+		transformer.POST("/remove", controller.Transformer.Remove)
+		transformer.GET("/getList", controller.Transformer.GetList)
+	}
+
+	//智慧网关基本信息 控制器
+	wisdomGateway := device.Group("wisdomgateway")
+	{
+		wisdomGateway.GET("/detail", controller.WisdomGateway.Detail)
+		wisdomGateway.GET("/list", controller.WisdomGateway.List)
+		wisdomGateway.POST("/submit", controller.WisdomGateway.CreateOrUpdate)
+		wisdomGateway.POST("/remove", controller.WisdomGateway.Remove)
+		wisdomGateway.GET("/getList", controller.WisdomGateway.GetList)
+		wisdomGateway.GET("/getRelevanceDetail", controller.WisdomGateway.GetRelevanceDetail)
+		wisdomGateway.POST("/import-excel", controller.WisdomGateway.ImportExcel)
+		wisdomGateway.GET("/export-excel", controller.WisdomGateway.ExportExcel)
+		wisdomGateway.GET("/export-template", controller.WisdomGateway.ExportTemplate)
+	}
+
+	//zigBee网关 控制器
+	zigbee := device.Group("zigbee")
+	{
+		zigbee.GET("/detail", controller.Zigbee.Detail)
+		zigbee.GET("/list", controller.Zigbee.List)
+		zigbee.POST("/submit", controller.Zigbee.CreateOrUpdate)
+		zigbee.POST("/remove", controller.Zigbee.Remove)
+		zigbee.GET("/getList", controller.Zigbee.GetList)
+		zigbee.POST("/import-excel", controller.Zigbee.ImportExcel)
+		zigbee.GET("/export-excel", controller.Zigbee.ExportExcel)
+		zigbee.GET("/export-template", controller.Zigbee.ExportTemplate)
 	}
 }