router.go 25 KB

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