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