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:
@@ -47,18 +47,18 @@ type mediaAssetQuery struct {
|
||||
mediaAssetQueryDo mediaAssetQueryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int64
|
||||
TenantID field.Int64
|
||||
UserID field.Int64
|
||||
Type field.Field
|
||||
Status field.Field
|
||||
Provider field.String
|
||||
Bucket field.String
|
||||
ObjectKey field.String
|
||||
Meta field.JSONB
|
||||
DeletedAt field.Field
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
ID field.Int64 // 主键ID:自增;仅用于内部关联
|
||||
TenantID field.Int64 // 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id
|
||||
UserID field.Int64 // 用户ID:资源上传者;用于审计与权限控制
|
||||
Type field.Field // 资源类型:video/audio/image;决定后续处理流程(转码/缩略图/封面等)
|
||||
Status field.Field // 处理状态:uploaded/processing/ready/failed/deleted;ready 才可被内容引用对外提供
|
||||
Provider field.String // 存储提供方:例如 s3/minio/oss;便于多存储扩展
|
||||
Bucket field.String // 存储桶:对象所在 bucket;与 provider 组合确定存储定位
|
||||
ObjectKey field.String // 对象键:对象在 bucket 内的 key;不得暴露可长期复用的直链(通过签名URL/token下发)
|
||||
Meta field.JSONB // 元数据:JSON;包含 hash、duration、width、height、bitrate、codec 等;用于展示与计费/风控
|
||||
DeletedAt field.Field // 软删除时间:非空表示已删除;对外接口需过滤
|
||||
CreatedAt field.Time // 创建时间:默认 now();用于审计与排序
|
||||
UpdatedAt field.Time // 更新时间:默认 now();更新状态/元数据时写入
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user