gatewayRelationService.go 536 B

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