Files
kontor/kontor-gin/internal/service/vendor.go
T
Thomas Peetz f5abb44466
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
WIP: Export Kontor DB
2026-09-30 18:55:59 +02:00

28 lines
678 B
Go

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)
}