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:
@@ -44,15 +44,15 @@ type contentAssetQuery struct {
|
||||
contentAssetQueryDo contentAssetQueryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int64
|
||||
TenantID field.Int64
|
||||
UserID field.Int64
|
||||
ContentID field.Int64
|
||||
AssetID field.Int64
|
||||
Role field.Field
|
||||
Sort field.Int32
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
ID field.Int64 // 主键ID:自增
|
||||
TenantID field.Int64 // 租户ID:多租户隔离;必须与 content_id、asset_id 所属租户一致
|
||||
UserID field.Int64 // 用户ID:操作人/绑定人;用于审计(通常为租户管理员或作者)
|
||||
ContentID field.Int64 // 内容ID:关联 contents.id;用于查询内容下资源列表
|
||||
AssetID field.Int64 // 资源ID:关联 media_assets.id;用于查询资源归属内容
|
||||
Role field.Field // 资源角色:main/cover/preview;preview 必须为独立资源以满足禁下载与防绕过
|
||||
Sort field.Int32 // 排序:同一 role 下的展示顺序,数值越小越靠前
|
||||
CreatedAt field.Time // 创建时间:默认 now();用于审计
|
||||
UpdatedAt field.Time // 更新时间:默认 now();更新 sort/role 时写入
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user