2026-09-19 14:17:27 +02:00
|
|
|
package repository
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"github.com/example/cms/internal/domain"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type IUserRepository interface {
|
|
|
|
|
FindOrCreateByIdentity(context.Context, domain.User) (domain.User, error)
|
|
|
|
|
}
|
2026-09-19 14:56:49 +02:00
|
|
|
type IUserLookup interface {
|
|
|
|
|
FindByID(context.Context, uint) (domain.User, error)
|
|
|
|
|
}
|
2026-09-19 14:17:27 +02:00
|
|
|
type IAdminRepository interface {
|
|
|
|
|
FindByEmail(context.Context, string) (domain.Admin, error)
|
|
|
|
|
}
|
|
|
|
|
type ISessionRepository interface {
|
|
|
|
|
Create(context.Context, domain.Session) error
|
|
|
|
|
FindValid(context.Context, string) (domain.Session, error)
|
|
|
|
|
}
|
2026-09-19 14:56:49 +02:00
|
|
|
type IContentRepository interface {
|
2026-09-19 15:11:12 +02:00
|
|
|
List(context.Context, int, int, string, []string) ([]domain.Content, error)
|
|
|
|
|
ListCategories(context.Context) ([]domain.Category, error)
|
2026-09-19 14:56:49 +02:00
|
|
|
FindBySlug(context.Context, string) (domain.Content, error)
|
|
|
|
|
Update(context.Context, domain.Content, domain.ContentHistory) error
|
|
|
|
|
}
|