12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package service
- import (
- "iot_manager_service/app/device/dao"
- "iot_manager_service/app/device/model"
- "iot_manager_service/util"
- )
- // 中间件管理服务
- var WorkbenchService = new(workbenchService)
- type workbenchService struct{}
- func (s *workbenchService) CountDevice(tenantId int) ([]dao.CountDevice, *util.Errors) {
- counts, err := dao.GetDeviceCount(tenantId)
- if err != nil {
- return nil, util.FailResponse(err.Error(), nil)
- }
- return counts, nil
- }
- func (s *workbenchService) CountAlarm(tenantId int) (*dao.CountAlarm, *util.Errors) {
- count, err := dao.GetAlarmCount(tenantId)
- if err != nil {
- return nil, util.FailResponse(err.Error(), nil)
- }
- return count, nil
- }
- func (s *workbenchService) CountJobTodo(tenantId int) (*dao.CountAlarm, *util.Errors) {
- count, err := dao.GetAlarmCount(tenantId)
- if err != nil {
- return nil, util.FailResponse(err.Error(), nil)
- }
- return count, nil
- }
- func (s *workbenchService) Notification(tenantId int) (*dao.Notification, *util.Errors) {
- notification, err := dao.GetNotification(tenantId)
- if err != nil {
- return nil, util.FailResponse(err.Error(), nil)
- }
- return notification, nil
- }
- func (s *workbenchService) LightRate(tenantId int) (*model.RspLightRate, *util.Errors) {
- var rsp model.RspLightRate
- return &rsp, nil
- }
|