add tysc handlers to kontor-gin

This commit is contained in:
2026-09-30 04:12:03 +02:00
parent c848758821
commit f912dcb670
100 changed files with 2420 additions and 1064 deletions
@@ -0,0 +1,27 @@
package repository
import (
"context"
"kontor-api-gin/internal/models"
"log/slog"
"gorm.io/gorm"
)
type PublisherRepository struct {
db *gorm.DB
}
func NewPublisherRepository(db *gorm.DB) *PublisherRepository {
repo := &PublisherRepository{db: db}
return repo
}
func (repository *PublisherRepository) FindAll(context context.Context) ([]models.Publisher, error) {
var publishers []models.Publisher
result := repository.db.Find(&publishers)
slog.Info("PublisherRepository#FindAll", "count", result.RowsAffected)
return publishers, nil
}