Device.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package routers
  2. import (
  3. "Cold_Api/conf"
  4. "Cold_Api/controllers"
  5. beego "github.com/beego/beego/v2/server/web"
  6. )
  7. func init() {
  8. ns := beego.NewNamespace(conf.Version,
  9. beego.NSNamespace("/Device",
  10. beego.NSBefore(T_pidFilter),
  11. //设备
  12. beego.NSRouter("/List", &controllers.DeviceController{}, "*:Device_List"), // 设备列表
  13. beego.NSRouter("/Add", &controllers.DeviceController{}, "*:Device_Add"), // 添加设备
  14. beego.NSRouter("/Get", &controllers.DeviceController{}, "*:Device_Get"), // 获取设备
  15. //beego.NSRouter("/Del", &controllers.DeviceController{}, "*:Device_Del"), // 删除设备 - 弃用
  16. beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:Device_Edit"), // 修改设备
  17. beego.NSRouter("/RestartShutdown", &controllers.DeviceController{}, "*:Device_RestartShutdown"), // 重启/关机
  18. beego.NSRouter("/ProductUpgrade", &controllers.DeviceController{}, "*:Device_ProductUpgrade"), // 版本升级
  19. beego.NSRouter("/Parameter_Get", &controllers.DeviceController{}, "*:Device_Parameter_Get"), // 设备参数
  20. beego.NSRouter("/Parameter_List", &controllers.DeviceController{}, "*:Device_Parameter_List"), // 设备参数列表
  21. beego.NSRouter("/Parameter_Pu", &controllers.DeviceController{}, "*:Device_Parameter_Pu"), // 修改设备参数
  22. beego.NSRouter("/Parameter_Sync", &controllers.DeviceController{}, "*:Device_Parameter_Sync"), // 修改设备参数
  23. //beego.NSRouter("/Device_Parameter_Del_Device", &controllers.DeviceController{}, "*:Device_Parameter_Del_Device"), // 删除此设备 - 弃用
  24. // 设备日志
  25. beego.NSRouter("/Log", &controllers.DeviceController{}, "*:DeviceLogs"), // 日志
  26. // 设备任务
  27. //beego.NSRouter("/DeviceTask_List", &controllers.DeviceController{}, "*:DeviceTask_List"), // 任务列表
  28. beego.NSRouter("/DeviceTask_List", &controllers.DeviceController{}, "*:DeviceTask_All"), // 任务列表
  29. beego.NSRouter("/DeviceTask_Post", &controllers.DeviceController{}, "*:DeviceTask_Post"), // 远程启停
  30. // 分类绑定
  31. beego.NSRouter("/DeviceClassBind_List", &controllers.DeviceController{}, "*:DeviceClassBind_List"), // 设备传感器绑定的分类列表
  32. // 报警策略绑定
  33. beego.NSRouter("/DeviceNoticeBind_List", &controllers.DeviceController{}, "*:DeviceNoticeBind_List"), // 设备传感器绑定的报警策略列表
  34. beego.NSRouter("/Applet_Stat_View2", &controllers.DeviceController{}, "*:Device_Applet_Stat"), // 设备统计 - 小程序
  35. beego.NSRouter("/Applet_Get", &controllers.DeviceController{}, "*:Device_Applet_Get"), // 获取设备 - 小程序
  36. ),
  37. // 传感器
  38. beego.NSNamespace("/DeviceSensor",
  39. beego.NSBefore(T_pidFilter),
  40. // 设备-传感器
  41. beego.NSRouter("/List", &controllers.DeviceController{}, "*:DeviceSensor_List"), // 传感器列表
  42. beego.NSRouter("/List_BySN", &controllers.DeviceController{}, "*:DeviceSensor_List_BySN"), // 传感器列表
  43. beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:DeviceSensor_Edit"), // 修改传感器
  44. //beego.NSRouter("/Del", &controllers.DeviceController{}, "*:DeviceSensor_Del"), // 删除传感器 -弃用
  45. beego.NSRouter("/Parameter_Get", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_Get"), // 传感器参数
  46. beego.NSRouter("/Parameter_List", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_List"), // 传感器参数列表
  47. beego.NSRouter("/Parameter_Pu", &controllers.DeviceController{}, "*:DeviceSensor_Parameter_Pu"), // 修改传感器参数
  48. // 传感器管理列表
  49. beego.NSRouter("/Manage_List", &controllers.DeviceController{}, "*:DeviceSensor_Manage_List"), // 传感器管理列表
  50. beego.NSRouter("/Applet_List_View1", &controllers.DeviceController{}, "*:DeviceSensor_Applet_List_View1"), // 传感器列表 - 小程序
  51. beego.NSRouter("/Applet_List_View2", &controllers.DeviceController{}, "*:DeviceSensor_Applet_List_View2"), // 设备列表 - 小程序
  52. ),
  53. // 传感器类型
  54. beego.NSNamespace("/DeviceSensorType",
  55. beego.NSBefore(T_pidFilter),
  56. beego.NSRouter("/List", &controllers.DeviceController{}, "*:DeviceSensorType_List"), // 传感器设备类型列表
  57. beego.NSRouter("/List_All", &controllers.DeviceController{}, "*:DeviceSensorType_List_All"), // 传感器设备类型列表
  58. ),
  59. // 分类
  60. beego.NSNamespace("/Class",
  61. beego.NSBefore(T_pidFilter),
  62. beego.NSRouter("/List", &controllers.DeviceController{}, "*:CompanyClass_List"), // 分类列表
  63. beego.NSRouter("/All", &controllers.DeviceController{}, "*:CompanyClass_All"), // 所有分类列表
  64. beego.NSRouter("/Company_All", &controllers.DeviceController{}, "*:CompanyClass_All_For_Company"), // 所有分类列表
  65. beego.NSRouter("/Get", &controllers.DeviceController{}, "*:CompanyClass_Get"), // 获取分类
  66. beego.NSRouter("/Add", &controllers.DeviceController{}, "*:CompanyClass_Add"), // 添加分类
  67. beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:CompanyClass_Edit"), // 修改分类
  68. beego.NSRouter("/Del", &controllers.DeviceController{}, "*:CompanyClass_Del"), // 删除分类
  69. // 分类绑定
  70. beego.NSRouter("/Bind_Add", &controllers.DeviceController{}, "*:ClassBind_Add"), // 添加分类设备绑定
  71. beego.NSRouter("/Bind_Del", &controllers.DeviceController{}, "*:ClassBind_Del"), // 删除分类设备绑定
  72. ),
  73. //报警策略
  74. beego.NSNamespace("/Notice",
  75. beego.NSBefore(T_pidFilter),
  76. beego.NSRouter("/List", &controllers.DeviceController{}, "*:CompanyNotice_List"), // 报警策略列表
  77. beego.NSRouter("/All", &controllers.DeviceController{}, "*:CompanyNotice_All"), // 所有报警策略列表
  78. beego.NSRouter("/Get", &controllers.DeviceController{}, "*:CompanyNotice_Get"), // 获取报警策略
  79. beego.NSRouter("/Add", &controllers.DeviceController{}, "*:CompanyNotice_Add"), // 添加报警策略
  80. beego.NSRouter("/Edit", &controllers.DeviceController{}, "*:CompanyNotice_Edit"), // 修改报警策略
  81. beego.NSRouter("/Del", &controllers.DeviceController{}, "*:CompanyNotice_Del"), // 删除报警策略
  82. beego.NSRouter("/Reset_Mechanism", &controllers.DeviceController{}, "*:CompanyNotice_Reset_Mechanism"), // 重置报警机制
  83. // 报警策略绑定
  84. beego.NSRouter("/Bind_Add", &controllers.DeviceController{}, "*:NoticeBind_Add"), // 添加报警策略绑定
  85. beego.NSRouter("/Bind_Del", &controllers.DeviceController{}, "*:NoticeBind_Del"), // 删除报警策略绑定
  86. // 报警通知用户列表
  87. beego.NSRouter("/User_List", &controllers.UserController{}, "*:User_Notice_List"), // 报警通知用户列表
  88. ),
  89. )
  90. beego.AddNamespace(ns)
  91. }