【feat】首页面板告警数据

This commit is contained in:
XM-GO
2023-09-25 11:47:39 +08:00
parent d3a7deb66f
commit cdbbe85a70
6 changed files with 214 additions and 1 deletions

View File

@@ -20,6 +20,14 @@ func InitDeviceAlarmRouter(container *restful.Container) {
ws.Path("/device/alarm").Produces(restful.MIME_JSON)
tags := []string{"alarm"}
ws.Route(ws.GET("/panel").To(func(request *restful.Request, response *restful.Response) {
restfulx.NewReqCtx(request, response).WithLog("获取面板告警分组").Handle(s.GetDeviceAlarmPanel)
}).
Doc("获取面板告警分组").
Metadata(restfulspec.KeyOpenAPITags, tags).
Writes(entity.DeviceAlarmCount{}).
Returns(200, "OK", entity.DeviceAlarmCount{}))
ws.Route(ws.GET("/list").To(func(request *restful.Request, response *restful.Response) {
restfulx.NewReqCtx(request, response).WithLog("获取告警分页列表").Handle(s.GetDeviceAlarmList)
}).