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