package service

import (
	"iot_manager_service/app/device/dao"
	"iot_manager_service/util/common"
)

// 中间件管理服务
var GatewayRelationService = new(gatewayRelationService)

type gatewayRelationService struct{}

func (s *gatewayRelationService) Get(id int) (*dao.GatewayRelation, *common.Errors) {
	// 创建查询实例
	relation := &dao.GatewayRelation{
		ID: id,
	}
	err := relation.Get()
	//relation.Update() //临时 处理
	if err != nil {
		return nil, common.FailResponse(err.Error(), nil)
	}
	return relation, nil
}
