23 lines
527 B
Go
23 lines
527 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"kontor-api-gin/internal/models"
|
|
"kontor-api-gin/internal/repository"
|
|
"log/slog"
|
|
)
|
|
|
|
type PublisherService struct {
|
|
repository *repository.PublisherRepository
|
|
}
|
|
|
|
func NewPublisherService(repo *repository.PublisherRepository) *PublisherService {
|
|
service := &PublisherService{repository: repo}
|
|
return service
|
|
}
|
|
|
|
func (service *PublisherService) List(context context.Context) ([]models.Publisher, error) {
|
|
slog.Info("PublisherService#List")
|
|
return service.repository.FindAll(context)
|
|
}
|