add tysc handlers to kontor-gin
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type PositionService struct {
|
||||
repository *repository.PositionRepository
|
||||
}
|
||||
|
||||
func NewPositionService(repo *repository.PositionRepository) *PositionService {
|
||||
service := &PositionService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *PositionService) List(context context.Context) ([]models.Position, error) {
|
||||
slog.Info("PositionService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *PositionService) Get(context context.Context, id string) (models.Position, error) {
|
||||
slog.Info("PositionService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
Reference in New Issue
Block a user