Documentation
¶
Overview ¶
Package crud 是 data 门面子包:框架无关 CRUD——Service/Repository/查询构造。
re-export 自 github.com/oekit/gormx/crud:类型为泛型 type alias(与源包**完全同一类型**, 双向赋值互通;泛型别名需 go 1.25+);非泛型函数/变量经 var 引用同一函数值。 源包新增导出符号时本壳需同步(门面跟版税,data 门面化决策已接受)。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = src.ErrNotFound
View Source
var NewQuery = src.NewQuery
Functions ¶
This section is empty.
Types ¶
type BaseService ¶
type BaseService[T any, ID comparable, CreateReq, UpdateReq any] = src.BaseService[T, ID, CreateReq, UpdateReq]
func NewBaseService ¶
func NewBaseService[T any, ID comparable, CreateReq, UpdateReq any](repo Repository[T, ID]) *BaseService[T, ID, CreateReq, UpdateReq]
NewBaseService 创建通用 CRUD Service。 ID 为实体主键类型(int64 自增 / string 文本主键等)。
type PageResponse ¶
type PageResponse[T any] = src.PageResponse[T]
type Repository ¶
type Repository[T any, ID comparable] = src.Repository[T, ID]
type Service ¶
type Service[T any, ID comparable, CreateReq, UpdateReq any] = src.Service[T, ID, CreateReq, UpdateReq]
type TxRepository ¶
type TxRepository[T any, ID comparable] = src.TxRepository[T, ID]
Click to show internal directories.
Click to hide internal directories.