This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type ArtistService struct {
|
||||
repository *repository.ArtistRepository
|
||||
}
|
||||
|
||||
func NewArtistService(repo *repository.ArtistRepository) *ArtistService {
|
||||
service := &ArtistService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *ArtistService) List(context context.Context) ([]models.Artist, error) {
|
||||
slog.Info("ArtistService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type CardService struct {
|
||||
repository *repository.CardRepository
|
||||
}
|
||||
|
||||
func NewCardService(repo *repository.CardRepository) *CardService {
|
||||
service := &CardService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *CardService) List(context context.Context) ([]models.Card, error) {
|
||||
slog.Info("CardService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *CardService) Get(context context.Context, id string) (models.Card, error) {
|
||||
slog.Info("CardService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type CardSetService struct {
|
||||
repository *repository.CardSetRepository
|
||||
}
|
||||
|
||||
func NewCardSetService(repo *repository.CardSetRepository) *CardSetService {
|
||||
service := &CardSetService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *CardSetService) List(context context.Context) ([]models.CardSet, error) {
|
||||
slog.Info("CardSetService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *CardSetService) Get(context context.Context, id string) (models.CardSet, error) {
|
||||
slog.Info("CardSetService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type ComicworkService struct {
|
||||
repository *repository.ComicworkRepository
|
||||
}
|
||||
|
||||
func NewComicworkService(repo *repository.ComicworkRepository) *ComicworkService {
|
||||
service := &ComicworkService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *ComicworkService) List(context context.Context) ([]models.ComicWork, error) {
|
||||
slog.Info("ComicworkService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type IssueService struct {
|
||||
repository *repository.IssueRepository
|
||||
}
|
||||
|
||||
func NewIssueService(repo *repository.IssueRepository) *IssueService {
|
||||
service := &IssueService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *IssueService) List(context context.Context) ([]models.Issue, error) {
|
||||
slog.Info("IssueService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type IssueworkService struct {
|
||||
repository *repository.IssueworkRepository
|
||||
}
|
||||
|
||||
func NewIssueworkService(repo *repository.IssueworkRepository) *IssueworkService {
|
||||
service := &IssueworkService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *IssueworkService) List(context context.Context) ([]models.IssueWork, error) {
|
||||
slog.Info("IssueworkService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type RoosterService struct {
|
||||
repository *repository.RoosterRepository
|
||||
}
|
||||
|
||||
func NewRoosterService(repo *repository.RoosterRepository) *RoosterService {
|
||||
service := &RoosterService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *RoosterService) List(context context.Context) ([]models.Rooster, error) {
|
||||
slog.Info("RoosterService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *RoosterService) Get(context context.Context, id string) (models.Rooster, error) {
|
||||
slog.Info("RoosterService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type StoryArcService struct {
|
||||
repository *repository.StoryArcRepository
|
||||
}
|
||||
|
||||
func NewStoryArcService(repo *repository.StoryArcRepository) *StoryArcService {
|
||||
service := &StoryArcService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *StoryArcService) List(context context.Context) ([]models.StoryArc, error) {
|
||||
slog.Info("StoryArcService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type VendorService struct {
|
||||
repository *repository.VendorRepository
|
||||
}
|
||||
|
||||
func NewVendorService(repo *repository.VendorRepository) *VendorService {
|
||||
service := &VendorService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *VendorService) List(context context.Context) ([]models.Vendor, error) {
|
||||
slog.Info("VendorService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *VendorService) Get(context context.Context, id string) (models.Vendor, error) {
|
||||
slog.Info("VendorService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type VolumeService struct {
|
||||
repository *repository.VolumeRepository
|
||||
}
|
||||
|
||||
func NewVolumeService(repo *repository.VolumeRepository) *VolumeService {
|
||||
service := &VolumeService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *VolumeService) List(context context.Context) ([]models.Volume, error) {
|
||||
slog.Info("VolumeService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type WorkTypeService struct {
|
||||
repository *repository.WorkTypeRepository
|
||||
}
|
||||
|
||||
func NewWorkTypeService(repo *repository.WorkTypeRepository) *WorkTypeService {
|
||||
service := &WorkTypeService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *WorkTypeService) List(context context.Context) ([]models.WorkType, error) {
|
||||
slog.Info("WorkTypeService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
Reference in New Issue
Block a user