【feat】首页面板数据

This commit is contained in:
XM-GO
2023-09-23 16:55:24 +08:00
parent 79314f6f7e
commit d3a7deb66f
10 changed files with 393 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ import (
func InitDeviceRouter(container *restful.Container) {
s := &api.DeviceApi{
DeviceApp: services.DeviceModelDao,
DeviceAlarmApp: services.DeviceAlarmModelDao,
ProductApp: services.ProductModelDao,
ProductTemplateApp: services.ProductTemplateModelDao,
}
@@ -22,6 +23,14 @@ func InitDeviceRouter(container *restful.Container) {
ws.Path("/device").Produces(restful.MIME_JSON)
tags := []string{"device"}
ws.Route(ws.GET("/panel").To(func(request *restful.Request, response *restful.Response) {
restfulx.NewReqCtx(request, response).WithLog("获取DevicePanel").Handle(s.GetDevicePanel)
}).
Doc("获取DevicePanel").
Metadata(restfulspec.KeyOpenAPITags, tags).
Writes(entity.DeviceTotalOutput{}).
Returns(200, "OK", entity.DeviceTotalOutput{}))
ws.Route(ws.GET("/list").To(func(request *restful.Request, response *restful.Response) {
restfulx.NewReqCtx(request, response).WithLog("获取Device分页列表").Handle(s.GetDeviceList)
}).