This commit is contained in:
2025-07-20 20:53:26 +08:00
parent 83bf9aea7d
commit 8ad1d7288e
158 changed files with 18156 additions and 13188 deletions

View File

@@ -24,7 +24,7 @@ type BaseRepository interface {
Restore(ctx context.Context, id string) error
}
// Repository 通用仓储接口,支持泛型
// Repository 仓储接口
type Repository[T any] interface {
BaseRepository
@@ -39,11 +39,8 @@ type Repository[T any] interface {
UpdateBatch(ctx context.Context, entities []T) error
DeleteBatch(ctx context.Context, ids []string) error
// 查询操作
// 列表查询
List(ctx context.Context, options ListOptions) ([]T, error)
// 事务支持
WithTx(tx interface{}) Repository[T]
}
// ListOptions 列表查询选项