router.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. device "iot_manager_service/app/device/controller"
  5. "iot_manager_service/app/middleware"
  6. multimedia "iot_manager_service/app/multimedia/controller"
  7. operation "iot_manager_service/app/operation/controller"
  8. record "iot_manager_service/app/record/controller"
  9. security "iot_manager_service/app/security/controller"
  10. system "iot_manager_service/app/system/controller"
  11. warn "iot_manager_service/app/warn/controller"
  12. "iot_manager_service/util/logger"
  13. )
  14. func InitRouter(engine *gin.Engine) {
  15. // 跨域处理
  16. engine.Use(middleware.Cors())
  17. // 校验权限
  18. engine.Use(middleware.CheckAuth())
  19. engine.Use(gin.Recovery())
  20. engine.Use(logger.LogToFile())
  21. engine.Use(logger.Recover)
  22. // 操作历史记录
  23. handleHistory := engine.Group("/api/longchi/handlehistory")
  24. {
  25. handleHistory.GET("/list", device.HandleHistory.List)
  26. }
  27. // 设备管理
  28. deviceMgr := engine.Group("/api/longchi/device/")
  29. //设备模型
  30. vendor := deviceMgr.Group("vender")
  31. {
  32. vendor.GET("/getModelList", device.Util.GetModelList)
  33. vendor.GET("/getTypeList", device.Util.GetModelList)
  34. }
  35. //公共方法
  36. share := engine.Group("/api/longchi/share")
  37. {
  38. share.GET("/tenantcode/getTenantCode", device.Util.GetTenantCode)
  39. }
  40. //桥梁
  41. bridge := deviceMgr.Group("bridge")
  42. {
  43. bridge.GET("/detail", device.Bridge.Detail)
  44. bridge.GET("/list", device.Bridge.List)
  45. bridge.POST("/submit", device.Bridge.CreateOrUpdate)
  46. bridge.POST("/remove", device.Bridge.Remove)
  47. bridge.GET("/dropdown", device.Bridge.GetList)
  48. bridge.POST("/import-excel", device.Bridge.ImportExcel)
  49. bridge.GET("/export-excel", device.Bridge.ExportExcel)
  50. bridge.GET("/export-template", device.Bridge.ExportTemplate)
  51. }
  52. //桥梁传感器 控制器
  53. bridgeSensor := deviceMgr.Group("bridgesensor")
  54. {
  55. bridgeSensor.GET("/detail", device.BridgeSensor.Detail)
  56. bridgeSensor.GET("/list", device.BridgeSensor.List)
  57. bridgeSensor.POST("/submit", device.BridgeSensor.CreateOrUpdate)
  58. bridgeSensor.POST("/remove", device.BridgeSensor.Remove)
  59. bridgeSensor.GET("/dropdown", device.BridgeSensor.GetList)
  60. bridgeSensor.POST("/enable-disable", device.BridgeSensor.Enable)
  61. bridgeSensor.POST("/import-excel", device.BridgeSensor.ImportExcel)
  62. bridgeSensor.GET("/export-excel", device.BridgeSensor.ExportExcel)
  63. bridgeSensor.GET("/export-template", device.BridgeSensor.ExportTemplate)
  64. }
  65. //摄像头
  66. camera := deviceMgr.Group("/camera")
  67. {
  68. camera.GET("/detail", device.Camera.Detail)
  69. camera.GET("/list", device.Camera.List)
  70. camera.POST("/submit", device.Camera.CreateOrUpdate)
  71. camera.POST("/remove", device.Camera.Remove)
  72. camera.POST("/import-excel", device.Camera.ImportExcel)
  73. camera.GET("/export-excel", device.Camera.ExportExcel)
  74. camera.GET("/export-template", device.Camera.ExportTemplate)
  75. camera.POST("/enable-disable", device.Camera.Enable)
  76. camera.GET("/getList", device.Camera.GetList)
  77. }
  78. //抓拍单元+卡口 控制器
  79. captureUnit := deviceMgr.Group("captureunit")
  80. {
  81. captureUnit.GET("/detail", device.CaptureUint.Detail)
  82. captureUnit.GET("/capture-list", device.CaptureUint.CaptureList)
  83. captureUnit.POST("/capture-submit", device.CaptureUint.CaptureSubmit)
  84. captureUnit.GET("/capture-pull-down-list", device.CaptureUint.CaptureGetList)
  85. captureUnit.GET("/point-list", device.CaptureUint.PointList)
  86. captureUnit.POST("/point-submit", device.CaptureUint.PointSubmit)
  87. captureUnit.GET("/point-pull-down-list", device.CaptureUint.PointGetList)
  88. captureUnit.POST("/remove", device.CaptureUint.Remove)
  89. }
  90. //垃圾桶台账 控制器
  91. garbage := deviceMgr.Group("garbage")
  92. {
  93. garbage.GET("/detail", device.Garbage.Detail)
  94. garbage.GET("/list", device.Garbage.List)
  95. garbage.POST("/submit", device.Garbage.CreateOrUpdate)
  96. garbage.POST("/remove", device.Garbage.Remove)
  97. garbage.GET("/dropdown", device.Garbage.GetList)
  98. garbage.POST("/import-excel", device.Garbage.ImportExcel)
  99. garbage.GET("/export-excel", device.Garbage.ExportExcel)
  100. garbage.GET("/export-template", device.Garbage.ExportTemplate)
  101. }
  102. //垃圾桶道路分组管理 控制器
  103. garbageWayGroup := deviceMgr.Group("garbage-way-group")
  104. {
  105. garbageWayGroup.GET("/detail", device.GarbageWay.Detail)
  106. garbageWayGroup.GET("/list", device.GarbageWay.List)
  107. garbageWayGroup.POST("/submit", device.GarbageWay.CreateOrUpdate)
  108. garbageWayGroup.POST("/remove", device.GarbageWay.Remove)
  109. garbageWayGroup.GET("/getList", device.GarbageWay.GetList)
  110. }
  111. //信息屏基本信息 控制器
  112. infoBoard := deviceMgr.Group("infoboard")
  113. {
  114. infoBoard.GET("/detail", device.InfoBoard.Detail)
  115. infoBoard.GET("/list", device.InfoBoard.List)
  116. infoBoard.POST("/submit", device.InfoBoard.CreateOrUpdate)
  117. infoBoard.POST("/remove", device.InfoBoard.Remove)
  118. infoBoard.POST("/import-excel", device.InfoBoard.ImportExcel)
  119. infoBoard.GET("/export-excel", device.InfoBoard.ExportExcel)
  120. infoBoard.GET("/export-template", device.InfoBoard.ExportTemplate)
  121. infoBoard.POST("/system-operation", device.InfoBoard.CreateOrUpdate)
  122. infoBoard.POST("/enable-disable", device.InfoBoard.Enable)
  123. infoBoard.POST("/show-setting", device.InfoBoard.ShowSetting)
  124. }
  125. //IP广播基本信息 控制器
  126. ipBroadCast := deviceMgr.Group("ipbroadcast")
  127. {
  128. ipBroadCast.GET("/detail", device.IpBroadcast.Detail)
  129. ipBroadCast.GET("/list", device.IpBroadcast.List)
  130. ipBroadCast.POST("/submit", device.IpBroadcast.CreateOrUpdate)
  131. ipBroadCast.POST("/remove", device.IpBroadcast.Remove)
  132. ipBroadCast.POST("/import-excel", device.IpBroadcast.ImportExcel)
  133. ipBroadCast.GET("/export-excel", device.IpBroadcast.ExportExcel)
  134. ipBroadCast.GET("/export-template", device.IpBroadcast.ExportTemplate)
  135. ipBroadCast.POST("/setting-volume", device.IpBroadcast.SettingVolume)
  136. }
  137. //一键报警服务表 控制器
  138. Alarm := deviceMgr.Group("akeyalarmserve")
  139. {
  140. Alarm.GET("/detail", device.Alarm.Detail)
  141. Alarm.GET("/list", device.Alarm.List)
  142. Alarm.POST("/submit", device.Alarm.CreateOrUpdate)
  143. Alarm.POST("/remove", device.Alarm.Remove)
  144. Alarm.GET("/getList", device.Alarm.GetList)
  145. Alarm.POST("/import-excel", device.Alarm.ImportExcel)
  146. Alarm.GET("/export-excel", device.Alarm.ExportExcel)
  147. Alarm.GET("/export-template", device.Alarm.ExportTemplate)
  148. }
  149. //一键报警终端表 控制器
  150. AlarmTerminal := deviceMgr.Group("akeyalarmterminal")
  151. {
  152. AlarmTerminal.GET("/detail", device.AlarmTerminal.Detail)
  153. AlarmTerminal.GET("/list", device.AlarmTerminal.List)
  154. AlarmTerminal.POST("/submit", device.AlarmTerminal.CreateOrUpdate)
  155. AlarmTerminal.POST("/remove", device.AlarmTerminal.Remove)
  156. AlarmTerminal.POST("/import-excel", device.AlarmTerminal.ImportExcel)
  157. AlarmTerminal.GET("/export-excel", device.AlarmTerminal.ExportExcel)
  158. AlarmTerminal.GET("/export-template", device.AlarmTerminal.ExportTemplate)
  159. }
  160. //灯杆基本信息 控制器
  161. lampPole := deviceMgr.Group("lamppole")
  162. {
  163. lampPole.GET("/detail", device.LampPole.Detail)
  164. lampPole.GET("/getRelevanceDetail", device.LampPole.GetRelevanceDetail)
  165. lampPole.GET("/list", device.LampPole.List)
  166. lampPole.POST("/submit", device.LampPole.CreateOrUpdate)
  167. lampPole.POST("/remove", device.LampPole.Remove)
  168. lampPole.GET("/getList", device.LampPole.GetList)
  169. lampPole.POST("/import-excel", device.LampPole.ImportExcel)
  170. lampPole.GET("/export-excel", device.LampPole.ExportExcel)
  171. lampPole.GET("/export-template", device.LampPole.ExportTemplate)
  172. }
  173. //灯杆分组
  174. lampPoleGroup := deviceMgr.Group("/lamppolegroup")
  175. {
  176. lampPoleGroup.GET("/detail", device.LampPoleGroup.Detail)
  177. lampPoleGroup.GET("/list", device.LampPoleGroup.List)
  178. lampPoleGroup.POST("/submit", device.LampPoleGroup.CreateOrUpdate)
  179. lampPoleGroup.POST("/remove", device.LampPoleGroup.Remove)
  180. lampPoleGroup.GET("/getList", device.LampPoleGroup.GetList)
  181. lampPoleGroup.GET("/filtration-list", device.LampPoleGroup.FiltrationList)
  182. lampPoleGroup.GET("/getTree", device.LampPoleGroup.GetTree)
  183. }
  184. //灯控基本信息 控制器
  185. lightControl := deviceMgr.Group("lightcontrol")
  186. {
  187. lightControl.GET("/detail", device.Light.Detail)
  188. lightControl.GET("/list", device.Light.List)
  189. lightControl.POST("/submit", device.Light.CreateOrUpdate)
  190. lightControl.POST("/remove", device.Light.Remove)
  191. lightControl.GET("/getLampPoleList", device.Light.GetList)
  192. lightControl.POST("/import-excel", device.Light.ImportExcel)
  193. lightControl.GET("/export-excel", device.Light.ExportExcel)
  194. lightControl.GET("/export-template", device.Light.ExportTemplate)
  195. lightControl.POST("/enable-disable", device.Light.Enable)
  196. lightControl.POST("/off-one", device.Light.Switch) //todo 在strategy中
  197. }
  198. manholeCover := deviceMgr.Group("manholecover")
  199. {
  200. manholeCover.GET("/detail", device.ManholeCover.Detail)
  201. manholeCover.GET("/list", device.ManholeCover.List)
  202. manholeCover.POST("/submit", device.ManholeCover.CreateOrUpdate)
  203. manholeCover.POST("/remove", device.ManholeCover.Remove)
  204. manholeCover.POST("/setting", device.ManholeCover.Setting)
  205. manholeCover.GET("/getList", device.ManholeCover.GetList)
  206. manholeCover.POST("/import-excel", device.ManholeCover.ImportExcel)
  207. manholeCover.GET("/export-excel", device.ManholeCover.ExportExcel)
  208. manholeCover.GET("/export-template", device.ManholeCover.ExportExcel)
  209. manholeCover.GET("/all-list", device.ManholeCover.AllList)
  210. }
  211. //灯随车走分组 控制器
  212. onDemandGroup := deviceMgr.Group("on-demand-group")
  213. {
  214. onDemandGroup.GET("/detail", device.OnDemandGroup.Detail)
  215. onDemandGroup.GET("/list", device.OnDemandGroup.List)
  216. onDemandGroup.POST("/submit", device.OnDemandGroup.CreateOrUpdate)
  217. onDemandGroup.POST("/remove", device.OnDemandGroup.Remove)
  218. onDemandGroup.GET("/getList", device.OnDemandGroup.GetList)
  219. onDemandGroup.GET("/group-number", device.OnDemandGroup.GroupNumber)
  220. }
  221. //灯随车走传感器 控制器
  222. onDemandSensor := deviceMgr.Group("on-demand-sensor")
  223. {
  224. onDemandSensor.GET("/detail", device.OnDemandSensor.Detail)
  225. onDemandSensor.GET("/list", device.OnDemandSensor.List)
  226. onDemandSensor.POST("/submit", device.OnDemandSensor.CreateOrUpdate)
  227. onDemandSensor.POST("/remove", device.OnDemandSensor.Remove)
  228. onDemandSensor.POST("/import-excel", device.OnDemandSensor.ImportExcel)
  229. onDemandSensor.GET("/export-excel", device.OnDemandSensor.ExportExcel)
  230. onDemandSensor.GET("/export-template", device.OnDemandSensor.ExportTemplate)
  231. }
  232. //环境传感器 控制器
  233. optoSensor := deviceMgr.Group("optosensor")
  234. {
  235. optoSensor.GET("/detail", device.OptoSensor.Detail)
  236. optoSensor.GET("/list", device.OptoSensor.List)
  237. optoSensor.POST("/submit", device.OptoSensor.CreateOrUpdate)
  238. optoSensor.POST("/remove", device.OptoSensor.Remove)
  239. optoSensor.GET("/getList", device.OptoSensor.GetList)
  240. optoSensor.POST("/set-default", device.OptoSensor.SetDefault)
  241. optoSensor.POST("/import-excel", device.OptoSensor.ImportExcel)
  242. optoSensor.GET("/export-excel", device.OptoSensor.ExportExcel)
  243. optoSensor.GET("/export-template", device.OptoSensor.ExportTemplate)
  244. }
  245. //配电箱基本信息 控制器
  246. switchBox := deviceMgr.Group("switchbox")
  247. {
  248. switchBox.GET("/detail", device.SwitchBox.Detail)
  249. switchBox.GET("/list", device.SwitchBox.List)
  250. switchBox.POST("/submit", device.SwitchBox.CreateOrUpdate)
  251. switchBox.POST("/remove", device.SwitchBox.Remove)
  252. switchBox.GET("/getList", device.SwitchBox.GetList)
  253. switchBox.POST("/import-excel", device.SwitchBox.ImportExcel)
  254. switchBox.GET("/export-excel", device.SwitchBox.ExportExcel)
  255. switchBox.GET("/export-template", device.SwitchBox.ExportTemplate)
  256. }
  257. //变压器基本信息 控制器
  258. transformer := deviceMgr.Group("transformer")
  259. {
  260. transformer.GET("/detail", device.Transformer.Detail)
  261. transformer.GET("/list", device.Transformer.List)
  262. transformer.POST("/submit", device.Transformer.CreateOrUpdate)
  263. transformer.POST("/remove", device.Transformer.Remove)
  264. transformer.GET("/getList", device.Transformer.GetList)
  265. }
  266. //智慧网关基本信息 控制器
  267. wisdomGateway := deviceMgr.Group("wisdomgateway")
  268. {
  269. wisdomGateway.GET("/detail", device.Gateway.Detail)
  270. wisdomGateway.GET("/list", device.Gateway.List)
  271. wisdomGateway.POST("/submit", device.Gateway.CreateOrUpdate)
  272. wisdomGateway.POST("/remove", device.Gateway.Remove)
  273. wisdomGateway.GET("/getList", device.Gateway.GetList)
  274. wisdomGateway.GET("/getRelevanceDetail", device.Gateway.GetRelevanceDetail)
  275. wisdomGateway.POST("/import-excel", device.Gateway.ImportExcel)
  276. wisdomGateway.GET("/export-excel", device.Gateway.ExportExcel)
  277. wisdomGateway.GET("/export-template", device.Gateway.ExportTemplate)
  278. }
  279. //zigBee网关 控制器
  280. zigbee := deviceMgr.Group("zigbee")
  281. {
  282. zigbee.GET("/detail", device.Zigbee.Detail)
  283. zigbee.GET("/list", device.Zigbee.List)
  284. zigbee.POST("/submit", device.Zigbee.CreateOrUpdate)
  285. zigbee.POST("/remove", device.Zigbee.Remove)
  286. zigbee.GET("/getList", device.Zigbee.GetList)
  287. zigbee.POST("/import-excel", device.Zigbee.ImportExcel)
  288. zigbee.GET("/export-excel", device.Zigbee.ExportExcel)
  289. zigbee.GET("/export-template", device.Zigbee.ExportTemplate)
  290. }
  291. // 设备控制相关
  292. strategy := engine.Group("/api/longchi/strategy")
  293. ////智能照明(灯杆分组/灯控树) 控制器
  294. //intelligentLighting := strategy.Group("IntelligentLighting")
  295. //{
  296. // intelligentLighting.GET("/detail", device.IntelligentLighting.Detail)
  297. // intelligentLighting.GET("/list", device.IntelligentLighting.List)
  298. // intelligentLighting.POST("/relationList", device.IntelligentLighting.RelationList)
  299. // intelligentLighting.POST("/relation", device.IntelligentLighting.Relation)
  300. // intelligentLighting.POST("/remove", device.IntelligentLighting.Remove)
  301. // intelligentLighting.POST("/changHandSwitch", device.IntelligentLighting.ChangeHandSwitch)
  302. // intelligentLighting.POST("/get_status", device.IntelligentLighting.GetStatus)
  303. //}
  304. //照明策略 控制器
  305. lightStrategy := strategy.Group("light")
  306. {
  307. lightStrategy.GET("/detail", device.LightStrategy.Detail)
  308. lightStrategy.GET("/list", device.LightStrategy.List)
  309. lightStrategy.POST("/submit", device.LightStrategy.CreateOrUpdate)
  310. lightStrategy.POST("/remove", device.LightStrategy.Remove)
  311. }
  312. //照明策略略关联(灯杆分组/灯控树形态) 控制器
  313. lightRelation := strategy.Group("lightrelation")
  314. {
  315. lightRelation.GET("/detail", device.IntelligentLighting.Detail)
  316. lightRelation.GET("/list", device.IntelligentLighting.List)
  317. lightRelation.POST("/remove", device.IntelligentLighting.Recovery)
  318. lightRelation.POST("/relationList", device.IntelligentLighting.RelationList)
  319. lightRelation.POST("/relation", device.IntelligentLighting.Relation)
  320. lightRelation.POST("/changeHandSwitch", device.IntelligentLighting.ChangeHandSwitch)
  321. }
  322. //灯随车走照明控制 控制器
  323. onDemandLightingControl := strategy.Group("onDemandLightingControl")
  324. {
  325. onDemandLightingControl.GET("/detail", device.OnDemandLightingControl.Detail)
  326. onDemandLightingControl.GET("/list", device.OnDemandLightingControl.List)
  327. onDemandLightingControl.POST("/relation", device.OnDemandLightingControl.Relation)
  328. onDemandLightingControl.POST("/changHandSwitch", device.OnDemandLightingControl.ChangeHandSwitch)
  329. }
  330. //登录校验相关
  331. auth := engine.Group("/api/blade-auth/oauth")
  332. {
  333. auth.POST("/token", system.Auth.Token)
  334. auth.GET("/logout", system.Auth.Logout)
  335. auth.GET("/captcha", system.Auth.Captcha)
  336. auth.GET("/clear-cache", system.Auth.Clear)
  337. }
  338. login := engine.Group("/api/login")
  339. {
  340. login.GET("", system.Auth.Login)
  341. }
  342. //用户
  343. user := engine.Group("/api/blade-user")
  344. {
  345. user.GET("/detail", system.User.GetDetail)
  346. user.GET("/page", system.User.List)
  347. user.POST("/submit", system.User.Submit)
  348. user.POST("/update", system.User.Update)
  349. user.POST("/remove", system.User.Remove)
  350. user.POST("/reset-password", system.User.ResetPwd)
  351. user.POST("/user-list", system.User.GetList)
  352. user.POST("/grant", system.User.Grant)
  353. }
  354. //租户
  355. tenant := engine.Group("/api/blade-system/tenant")
  356. {
  357. tenant.GET("/info", system.Tenant.GetInfo)
  358. tenant.GET("/detail", system.Tenant.GetDetail)
  359. tenant.GET("/page", system.Tenant.List)
  360. tenant.POST("/submit", system.Tenant.Submit)
  361. tenant.POST("/remove", system.Tenant.Remove)
  362. tenant.POST("/select", system.Tenant.GetList)
  363. tenant.GET("/list", system.Tenant.List)
  364. }
  365. //角色
  366. role := engine.Group("/api/blade-system/role")
  367. {
  368. role.GET("/detail", system.Role.GetDetail)
  369. role.GET("/list", system.Role.List)
  370. role.GET("/tree", system.Role.Tree)
  371. role.POST("/submit", system.Role.Submit)
  372. role.POST("/remove", system.Role.Remove)
  373. role.POST("/grant", system.Role.Grant)
  374. }
  375. //菜单
  376. menu := engine.Group("/api/blade-system/menu")
  377. {
  378. menu.GET("/detail", system.Menu.GetDetail)
  379. menu.GET("list", system.Menu.List)
  380. menu.GET("lazy-list", system.Menu.LazyList)
  381. menu.GET("menuList", system.Menu.MenuList)
  382. menu.GET("lazyMenuList", system.Menu.LazyMenuList)
  383. menu.POST("submit", system.Menu.Submit)
  384. menu.POST("remove", system.Menu.Remove)
  385. menu.GET("routes", system.Menu.Routes)
  386. menu.GET("routesExt", system.Menu.RoutesExt)
  387. menu.GET("buttons", system.Menu.Buttons)
  388. menu.GET("tree", system.Menu.Tree)
  389. menu.GET("grantTree", system.Menu.GrantTree)
  390. menu.GET("roleTreeKeys", system.Menu.RoleTreeKeys)
  391. menu.GET("grantTopTree", system.Menu.GrantTopTree)
  392. menu.GET("topTreeKeys", system.Menu.GrantTopTree)
  393. menu.GET("top-menu", system.Menu.TopMenu)
  394. menu.GET("authRoutes", system.Menu.Routes)
  395. }
  396. //字典
  397. dict := engine.Group("/api/blade-system/dict")
  398. {
  399. dict.GET("/dictionary", system.Dict.Dictionary)
  400. }
  401. //工作台
  402. workbench := engine.Group("/api/longchi/report/workbench/")
  403. {
  404. workbench.POST("countdevice", device.Workbench.CountDevice)
  405. workbench.POST("countalarm", device.Workbench.CountAlarm)
  406. workbench.POST("aqi", device.Workbench.Aqi)
  407. workbench.POST("countjobtodo", device.Workbench.CountJobTodo)
  408. workbench.POST("notification", device.Workbench.Notification)
  409. workbench.GET("light-pandect", device.Workbench.LightRate)
  410. }
  411. //记录
  412. recordGroup := engine.Group("/api/longchi/record")
  413. {
  414. //灯控
  415. lightRecord := recordGroup.Group("/lighting/lightingrecordhis")
  416. {
  417. lightRecord.GET("/list", record.LightRecord.List)
  418. lightRecord.GET("/detail", record.LightRecord.Detail)
  419. lightRecord.POST("/refresh", record.LightRecord.Refresh)
  420. }
  421. akeyalarmRecord := recordGroup.Group("/akeyalarm/keyalarmrecondhis")
  422. {
  423. akeyalarmRecord.GET("/list", record.AKeyAlarmRecord.List)
  424. akeyalarmRecord.GET("/detail", record.AKeyAlarmRecord.Detail)
  425. akeyalarmRecord.GET("/refresh", record.AKeyAlarmRecord.Refresh)
  426. akeyalarmRecord.POST("/dispose", record.AKeyAlarmRecord.Dispose)
  427. }
  428. }
  429. //安防
  430. securityGroup := engine.Group("/api/longchi/security")
  431. {
  432. securityGroup.GET("/getCameraLiveList", security.Security.GetCameraLiveList)
  433. securityGroup.GET("/operate", security.Security.Operate)
  434. securityGroup.POST("/ptzhome", security.Security.Ptzhome)
  435. securityMultiscreenGroup := securityGroup.Group("/multiscreen")
  436. {
  437. securityMultiscreenGroup.GET("list", security.Multiscreen.List)
  438. securityMultiscreenGroup.GET("cameraList", security.Security.GetCameraLiveList)
  439. securityMultiscreenGroup.POST("submit", security.Multiscreen.Submit)
  440. }
  441. securityRewindGroup := securityGroup.Group("/rewind")
  442. {
  443. securityRewindGroup.GET("getCameraLiveList", security.Security.GetCameraLiveList)
  444. securityRewindGroup.POST("rewind-text", security.Rewind.RewindText)
  445. }
  446. }
  447. // 媒体素材
  448. multimediaGroup := engine.Group("/api/longchi/multimedia/library")
  449. {
  450. multimediaGroup.GET("/list", multimedia.Library.List)
  451. multimediaGroup.GET("/detail", multimedia.Library.Detail)
  452. multimediaGroup.POST("/remove", multimedia.Library.Remove)
  453. multimediaGroup.GET("/getList", multimedia.Library.GetList)
  454. multimediaGroup.POST("/putFile", multimedia.Library.UploadFile)
  455. multimediaGroup.POST("/putMp3File", multimedia.Library.UploadFile)
  456. multimediaGroup.POST("/submit", multimedia.Library.Submit)
  457. }
  458. //上传设备图
  459. systemGroup := engine.Group("/api/longchi/system/public")
  460. {
  461. systemGroup.POST("/putFile", multimedia.Library.UploadFile)
  462. }
  463. // 媒体节目
  464. programGroup := engine.Group("/api/longchi/multimedia/programlibraries")
  465. {
  466. programGroup.GET("/list", multimedia.Program.List)
  467. programGroup.GET("/detail", multimedia.Program.Detail)
  468. programGroup.POST("/remove", multimedia.Program.Remove)
  469. programGroup.GET("/getList", multimedia.Program.GetList)
  470. programGroup.POST("/submit", multimedia.Program.Submit)
  471. programGroup.POST("/getLibraryList", multimedia.Program.GetLibraryList)
  472. programGroup.POST("/relationDeviceList", multimedia.Program.RelationDeviceList)
  473. //todo 前端需要和relationDeviceList合并,使用一个接口
  474. programGroup.POST("/ip-broadcast-relation-list", multimedia.Program.RelationIpBroadcastList)
  475. programGroup.POST("/audit", multimedia.Program.Audit)
  476. }
  477. //节目播放
  478. publishLibraries := engine.Group("/api/longchi/multimedia/publishlibraries")
  479. {
  480. publishLibraries.GET("/list", multimedia.PublishLibraries.List)
  481. publishLibraries.POST("/getLibraryList", multimedia.PublishLibraries.GetLibraryList)
  482. publishLibraries.GET("/affiliate-equipment", multimedia.PublishLibraries.AffiliateEquipment)
  483. publishLibraries.POST("/updateStatus", multimedia.PublishLibraries.UpdateStatus)
  484. }
  485. operationGroup := engine.Group("/api/longchi/operation")
  486. environment := operationGroup.Group("/em/environmentMonitor")
  487. {
  488. environment.GET("/getNewList", operation.Environment.EnvironmentList)
  489. environment.GET("/getNewMeteorologicalData", operation.Environment.GetData)
  490. environment.GET("/query-environment", operation.Environment.GetHistoryData)
  491. environment.GET("/getScopeList", operation.Environment.GetScopeList)
  492. }
  493. garbageGroup := operationGroup.Group("/garbage")
  494. {
  495. garbageGroup.GET("/query-way-realtime", operation.Garbage.GarbageList)
  496. garbageGroup.GET("/count-list", operation.Garbage.CountList)
  497. }
  498. bridgeGroup := operationGroup.Group("/bridge")
  499. {
  500. bridgeGroup.GET("/data/environmental/environmental-list", operation.Bridge.EnvironmentList)
  501. bridgeGroup.GET("/data/sensor/list", operation.Bridge.SensorList)
  502. bridgeGroup.GET("/data/sensor/realtime-data", operation.Bridge.LiveData)
  503. bridgeGroup.GET("/data/pandect/detail", operation.Bridge.Summary)
  504. bridgeGroup.GET("/data/pandect/health-indicators", operation.Bridge.HealthIndicators)
  505. bridgeGroup.GET("/data/pandect/list", operation.Bridge.SummaryList)
  506. bridgeGroup.GET("/data/pandect/camera-list", operation.Bridge.CameraList)
  507. }
  508. manholeGroup := operationGroup.Group("/manhole")
  509. {
  510. manholeGroup.GET("/now", operation.Manhole.LiveData)
  511. manholeGroup.GET("/history-list", operation.Manhole.LiveData)
  512. }
  513. //运营统计-设备
  514. operationDeviceGroup := operationGroup.Group("/device")
  515. {
  516. operationDeviceGroup.POST("count-device", operation.Device.CountDevice)
  517. operationDeviceGroup.POST("list", operation.Device.MonthList)
  518. operationDeviceGroup.POST("year-list", operation.Device.YearList)
  519. }
  520. //灯控能耗统计
  521. operationGroup.POST("/energy/list", operation.LightingRate.List)
  522. warnGroup := engine.Group("/api/longchi/alarm")
  523. {
  524. //告警设置
  525. noticeGroup := warnGroup.Group("notice")
  526. {
  527. noticeGroup.GET("/list", warn.NoticeSet.List)
  528. noticeGroup.POST("/update", warn.NoticeSet.Update)
  529. noticeGroup.POST("/remove", warn.NoticeSet.Remove)
  530. noticeGroup.GET("/detail", warn.NoticeSet.Detail)
  531. noticeGroup.GET("/getUserList", warn.NoticeSet.GetUserList)
  532. }
  533. //发送记录
  534. sendrecordGroup := warnGroup.Group("sendrecord")
  535. {
  536. sendrecordGroup.GET("/list", warn.NoticeRecord.List)
  537. }
  538. //运维告警记录
  539. alarmGroup := warnGroup.Group("alarm")
  540. {
  541. alarmGroup.GET("/list", warn.PlatformAlarm.List)
  542. alarmGroup.GET("/detail", warn.PlatformAlarm.Detail)
  543. alarmGroup.GET("/refresh", warn.PlatformAlarm.Refresh)
  544. alarmGroup.POST("/changeHandleType", warn.PlatformAlarm.HandleAlert)
  545. }
  546. //业务告警记录
  547. warnGroup.GET("/alarmrecords/list", warn.NoticeRecord.List)
  548. // 业务 策略 告警
  549. businesstacticsGroup := warnGroup.Group("businesstactics")
  550. {
  551. businesstacticsGroup.GET("/list", warn.BusinessTactics.List)
  552. businesstacticsGroup.GET("/detail", warn.BusinessTactics.Detail)
  553. businesstacticsGroup.POST("/submit", warn.BusinessTactics.SaveOrUpdate)
  554. businesstacticsGroup.POST("/remove", warn.BusinessTactics.Remove)
  555. businesstacticsGroup.POST("/enable-disable", warn.BusinessTactics.Enable)
  556. }
  557. }
  558. }