gatewayRelationService.go 488 B

1234567891011121314151617181920212223
  1. package service
  2. import (
  3. "iot_manager_service/app/device/dao"
  4. "iot_manager_service/util"
  5. )
  6. // 中间件管理服务
  7. var GatewayRelationService = new(gatewayRelationService)
  8. type gatewayRelationService struct{}
  9. func (s *gatewayRelationService) Get(id int) (*dao.GatewayRelation, *util.Errors) {
  10. // 创建查询实例
  11. relation := &dao.GatewayRelation{
  12. ID: id,
  13. }
  14. err := relation.Get()
  15. if err != nil {
  16. return nil, util.FailResponse(err.Error(), nil)
  17. }
  18. return relation, nil
  19. }