Files
kontor/kontor-gin/internal/service/token.go
T
Thomas Peetz 4aaf580735
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
WIP: Export Kontor DB
2026-10-01 17:40:17 +02:00

28 lines
666 B
Go

package service
import (
"context"
"kontor-api-gin/internal/models"
"kontor-api-gin/internal/repository"
"log/slog"
)
type TokenService struct {
repository *repository.TokenRepository
}
func NewTokenService(repo *repository.TokenRepository) *TokenService {
service := &TokenService{repository: repo}
return service
}
func (service *TokenService) List(context context.Context) ([]models.Token, error) {
slog.Info("TokenService#List")
return service.repository.FindAll(context)
}
func (service *TokenService) Get(context context.Context, id string) (models.Token, error) {
slog.Info("TokenService#Get")
return service.repository.GetById(context, id)
}