feat: add TenantLedger model and query generation
- Introduced TenantLedger model with fields for managing tenant transactions, including ID, TenantID, UserID, OrderID, transaction Type, Amount, and balance details. - Implemented CRUD operations for TenantLedger with methods for Create, Update, Delete, and Reload. - Generated query methods for TenantLedger to facilitate database interactions, including filtering, pagination, and aggregation functions. - Established relationships with Order model for foreign key references.
This commit is contained in:
@@ -48,19 +48,19 @@ type contentQuery struct {
|
||||
contentQueryDo contentQueryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int64
|
||||
TenantID field.Int64
|
||||
UserID field.Int64
|
||||
Title field.String
|
||||
Description field.String
|
||||
Status field.Field
|
||||
Visibility field.Field
|
||||
PreviewSeconds field.Int32
|
||||
PreviewDownloadable field.Bool
|
||||
PublishedAt field.Time
|
||||
DeletedAt field.Field
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
ID field.Int64 // 主键ID:自增;用于内容引用
|
||||
TenantID field.Int64 // 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id
|
||||
UserID field.Int64 // 用户ID:内容创建者/发布者;用于权限与审计(例如私有内容仅作者可见)
|
||||
Title field.String // 标题:用于列表展示与搜索;建议限制长度(由业务校验)
|
||||
Description field.String // 描述:用于详情页展示;可为空字符串
|
||||
Status field.Field // 状态:draft/reviewing/published/unpublished/blocked;published 才对外展示
|
||||
Visibility field.Field // 可见性:public/tenant_only/private;仅控制详情可见,正片资源仍需按价格/权益校验
|
||||
PreviewSeconds field.Int32 // 试看秒数:默认 60;只对 preview 资源生效;必须为正整数
|
||||
PreviewDownloadable field.Bool // 试看是否允许下载:默认 false;当前策略固定为不允许下载(仅 streaming)
|
||||
PublishedAt field.Time // 发布时间:首次发布时写入;用于时间窗与排序
|
||||
DeletedAt field.Field // 软删除时间:非空表示已删除;对外接口需过滤
|
||||
CreatedAt field.Time // 创建时间:默认 now();用于审计与排序
|
||||
UpdatedAt field.Time // 更新时间:默认 now();编辑内容时写入
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user