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:
2025-12-18 13:12:26 +08:00
parent f93caefcb2
commit 1da84f2af3
42 changed files with 6468 additions and 265 deletions

View File

@@ -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/deletedready 才可被内容引用对外提供
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
}