1234567891011121314151617181920212223 |
- package service
- import (
- "iot_manager_service/app/device/dao"
- "iot_manager_service/util"
- )
- // 中间件管理服务
- var GatewayRelationService = new(gatewayRelationService)
- type gatewayRelationService struct{}
- func (s *gatewayRelationService) Get(id int) (*dao.GatewayRelation, *util.Errors) {
- // 创建查询实例
- relation := &dao.GatewayRelation{
- ID: id,
- }
- err := relation.Get()
- if err != nil {
- return nil, util.FailResponse(err.Error(), nil)
- }
- return relation, nil
- }
|