information.go 726 B

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