property.go 669 B

123456789101112131415161718192021222324252627282930
  1. package service
  2. import (
  3. "city_chips/internal/model"
  4. "city_chips/internal/repository"
  5. "context"
  6. )
  7. type PropertyService interface {
  8. GetProperty(ctx context.Context, id int64) (*model.Property, error)
  9. }
  10. func NewPropertyService(
  11. service *Service,
  12. propertyRepository repository.PropertyRepository,
  13. ) PropertyService {
  14. return &propertyService{
  15. Service: service,
  16. propertyRepository: propertyRepository,
  17. }
  18. }
  19. type propertyService struct {
  20. *Service
  21. propertyRepository repository.PropertyRepository
  22. }
  23. func (s *propertyService) GetProperty(ctx context.Context, id int64) (*model.Property, error) {
  24. return s.propertyRepository.GetProperty(ctx, id)
  25. }