1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package service
- import (
- "city_chips/internal/model"
- "city_chips/internal/repository"
- "context"
- )
- type IntelligentBuildingControlService interface {
- GetIntelligentBuildingControl(ctx context.Context, id int64) (*model.IntelligentBuildingControl, error)
- GetPoint(conds map[string]any) (*[]model.Point, error)
- GetPointType() ([]string, error)
- }
- func NewIntelligentBuildingControlService(
- service *Service,
- intelligentBuildingControlRepository repository.IntelligentBuildingControlRepository,
- ) IntelligentBuildingControlService {
- return &intelligentBuildingControlService{
- Service: service,
- intelligentBuildingControlRepository: intelligentBuildingControlRepository,
- }
- }
- type intelligentBuildingControlService struct {
- *Service
- intelligentBuildingControlRepository repository.IntelligentBuildingControlRepository
- }
- // GetPointType implements IntelligentBuildingControlService.
- func (s *intelligentBuildingControlService) GetPointType() ([]string, error) {
- poions, err := s.intelligentBuildingControlRepository.GetPointType()
- if err != nil {
- return nil, err
- }
- return poions, nil
- }
- // GetPoint implements IntelligentBuildingControlService.
- func (s *intelligentBuildingControlService) GetPoint(conds map[string]any) (*[]model.Point, error) {
- points, err := s.intelligentBuildingControlRepository.GetPoint(conds)
- if err != nil {
- return &[]model.Point{}, err
- }
- return points, err
- }
- func (s *intelligentBuildingControlService) GetIntelligentBuildingControl(ctx context.Context, id int64) (*model.IntelligentBuildingControl, error) {
- return s.intelligentBuildingControlRepository.GetIntelligentBuildingControl(ctx, id)
- }
|