home.go 593 B

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