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