Files
kontor/kontor-gin/internal/repository/storyarc.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
543 B
Go

package repository
import (
"context"
"kontor-api-gin/internal/models"
"log/slog"
"gorm.io/gorm"
)
type StoryArcRepository struct {
db *gorm.DB
}
func NewStoryArcRepository(db *gorm.DB) *StoryArcRepository {
repo := &StoryArcRepository{db: db}
return repo
}
func (repository *StoryArcRepository) FindAll(context context.Context) ([]models.StoryArc, error) {
var storyArcs []models.StoryArc
result := repository.db.Find(&storyArcs)
slog.Info("StoryArcRepository#FindAll", "count", result.RowsAffected)
return storyArcs, nil
}