123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package routers
- import (
- "Cold_Api/conf"
- "Cold_Api/controllers"
- beego "github.com/beego/beego/v2/server/web"
- )
- func init() {
- ns := beego.NewNamespace(conf.Version,
- beego.NSNamespace("/Device",
- beego.NSBefore(T_pidFilter),
- //设备
- beego.NSRouter("/List", &controllers.DeviceController{}, "*:Device_List"), // 设备列表
- beego.NSRouter("/Add", &controllers.DeviceController{}, "*:Device_Add"), // 添加设备
- beego.NSRouter("/Get", &controllers.DeviceController{}, "*:Device_Get"), // 获取设备
- //beego.NSRouter("/Del", &controllers.DeviceController{}, "*:Device_Del"), // 删除设备 - 弃用
- beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:Device_Edit"), // 修改设备
- beego.NSRouter("/RestartShutdown", &controllers.DeviceController{}, "*:Device_RestartShutdown"), // 重启/关机
- beego.NSRouter("/ProductUpgrade", &controllers.DeviceController{}, "*:Device_ProductUpgrade"), // 版本升级
- beego.NSRouter("/Parameter_Get", &controllers.DeviceController{}, "*:Device_Parameter_Get"), // 设备参数
- beego.NSRouter("/Parameter_List", &controllers.DeviceController{}, "*:Device_Parameter_List"), // 设备参数列表
- beego.NSRouter("/Parameter_Pu", &controllers.DeviceController{}, "*:Device_Parameter_Pu"), // 修改设备参数
- beego.NSRouter("/Parameter_Sync", &controllers.DeviceController{}, "*:Device_Parameter_Sync"), // 修改设备参数
- //beego.NSRouter("/Device_Parameter_Del_Device", &controllers.DeviceController{}, "*:Device_Parameter_Del_Device"), // 删除此设备 - 弃用
- // 设备日志
- beego.NSRouter("/Log", &controllers.DeviceController{}, "*:DeviceLogs"), // 日志
- // 设备任务
- //beego.NSRouter("/DeviceTask_List", &controllers.DeviceController{}, "*:DeviceTask_List"), // 任务列表
- beego.NSRouter("/DeviceTask_List", &controllers.DeviceController{}, "*:DeviceTask_All"), // 任务列表
- beego.NSRouter("/DeviceTask_Post", &controllers.DeviceController{}, "*:DeviceTask_Post"), // 远程启停
- // 分类绑定
- beego.NSRouter("/DeviceClassBind_List", &controllers.DeviceController{}, "*:DeviceClassBind_List"), // 设备传感器绑定的分类列表
- // 报警策略绑定
- beego.NSRouter("/DeviceNoticeBind_List", &controllers.DeviceController{}, "*:DeviceNoticeBind_List"), // 设备传感器绑定的报警策略列表
- beego.NSRouter("/Applet_Stat_View2", &controllers.DeviceController{}, "*:Device_Applet_Stat"), // 设备统计 - 小程序
- beego.NSRouter("/Applet_Get", &controllers.DeviceController{}, "*:Device_Applet_Get"), // 获取设备 - 小程序
- ),
- // 传感器
- beego.NSNamespace("/DeviceSensor",
- beego.NSBefore(T_pidFilter),
- // 设备-传感器
- beego.NSRouter("/List", &controllers.DeviceController{}, "*:DeviceSensor_List"), // 传感器列表
- beego.NSRouter("/List_BySN", &controllers.DeviceController{}, "*:DeviceSensor_List_BySN"), // 传感器列表
- beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:DeviceSensor_Edit"), // 修改传感器
- //beego.NSRouter("/Del", &controllers.DeviceController{}, "*:DeviceSensor_Del"), // 删除传感器 -弃用
- beego.NSRouter("/Parameter_Get", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_Get"), // 传感器参数
- beego.NSRouter("/Parameter_List", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_List"), // 传感器参数列表
- beego.NSRouter("/Parameter_Pu", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_Pu"), // 修改传感器参数
- // 传感器管理列表
- beego.NSRouter("/Manage_List", &controllers.DeviceController{}, "*:DeviceSensor_Manage_List"), // 传感器管理列表
- beego.NSRouter("/Applet_List_View1", &controllers.DeviceController{}, "*:DeviceSensor_Applet_List_View1"), // 传感器列表 - 小程序
- beego.NSRouter("/Applet_List_View2", &controllers.DeviceController{}, "*:DeviceSensor_Applet_List_View2"), // 设备列表 - 小程序
- ),
- // 传感器类型
- beego.NSNamespace("/DeviceSensorType",
- beego.NSBefore(T_pidFilter),
- beego.NSRouter("/List", &controllers.DeviceController{}, "*:DeviceSensorType_List"), // 传感器设备类型列表
- beego.NSRouter("/List_All", &controllers.DeviceController{}, "*:DeviceSensorType_List_All"), // 传感器设备类型列表
- ),
- // 分类
- beego.NSNamespace("/Class",
- beego.NSBefore(T_pidFilter),
- beego.NSRouter("/List", &controllers.DeviceController{}, "*:CompanyClass_List"), // 分类列表
- beego.NSRouter("/All", &controllers.DeviceController{}, "*:CompanyClass_All"), // 所有分类列表
- beego.NSRouter("/Company_All", &controllers.DeviceController{}, "*:CompanyClass_All_For_Company"), // 所有分类列表
- beego.NSRouter("/Get", &controllers.DeviceController{}, "*:CompanyClass_Get"), // 获取分类
- beego.NSRouter("/Add", &controllers.DeviceController{}, "*:CompanyClass_Add"), // 添加分类
- beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:CompanyClass_Edit"), // 修改分类
- beego.NSRouter("/Del", &controllers.DeviceController{}, "*:CompanyClass_Del"), // 删除分类
- // 分类绑定
- beego.NSRouter("/Bind_Add", &controllers.DeviceController{}, "*:ClassBind_Add"), // 添加分类设备绑定
- beego.NSRouter("/Bind_Del", &controllers.DeviceController{}, "*:ClassBind_Del"), // 删除分类设备绑定
- ),
- //报警策略
- beego.NSNamespace("/Notice",
- beego.NSBefore(T_pidFilter),
- beego.NSRouter("/List", &controllers.DeviceController{}, "*:CompanyNotice_List"), // 报警策略列表
- beego.NSRouter("/All", &controllers.DeviceController{}, "*:CompanyNotice_All"), // 所有报警策略列表
- beego.NSRouter("/Get", &controllers.DeviceController{}, "*:CompanyNotice_Get"), // 获取报警策略
- beego.NSRouter("/Add", &controllers.DeviceController{}, "*:CompanyNotice_Add"), // 添加报警策略
- beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:CompanyNotice_Edit"), // 修改报警策略
- beego.NSRouter("/Del", &controllers.DeviceController{}, "*:CompanyNotice_Del"), // 删除报警策略
- beego.NSRouter("/Reset_Mechanism", &controllers.DeviceController{}, "*:CompanyNotice_Reset_Mechanism"), // 重置报警机制
- // 报警策略绑定
- beego.NSRouter("/Bind_Add", &controllers.DeviceController{}, "*:NoticeBind_Add"), // 添加报警策略绑定
- beego.NSRouter("/Bind_Del", &controllers.DeviceController{}, "*:NoticeBind_Del"), // 删除报警策略绑定
- // 报警通知用户列表
- beego.NSRouter("/User_List", &controllers.UserController{}, "*:User_Notice_List"), // 报警通知用户列表
- ),
- )
- beego.AddNamespace(ns)
- }
|