将全库资金金额从 float64 迁移到 shopspring/decimal,落定边界架构: 入口 NewFromFloat → 内部多步运算全程 decimal → 出口 InexactFloat64; DB NUMERIC(20,10) 走 driver.Valuer 精确直传,Redis 钱包用整数 micro-USD, CNY→USD 换汇仅在 payment.FulfillOrder recharge 分支。 - money.go 重写为 decimal 原生(运算/收敛/比较/边界/micro 工具) - billing/tenant/admin/payment/open/task 各层金额运算 decimal 化 - entity/do 资金列重生成为 decimal.Decimal(可空列 *decimal.Decimal) - 000013 迁移:非金额 NUMERIC 列 → double precision(5 表 13 列) - Res 出口 .InexactFloat64() 收敛,JSONB 快照缝隙显式转 float64 - CLAUDE.md 新增 decimal 强约束;补充迁移基线/完成总结文档
27 lines
1.2 KiB
Go
27 lines
1.2 KiB
Go
// =================================================================================
|
||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||
// =================================================================================
|
||
|
||
package do
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
"github.com/shopspring/decimal"
|
||
)
|
||
|
||
// BilWallets is the golang structure of table bil_wallets for DAO operations like Where/Data.
|
||
type BilWallets struct {
|
||
g.Meta `orm:"table:bil_wallets, do:true"`
|
||
Id any // 主键ID
|
||
TenantId any // 租户ID(每个租户一个钱包)
|
||
Balance any // 总余额
|
||
FrozenBalance any // 冻结余额(支付中/退款中,可用余额 = balance - frozen_balance)
|
||
WarningThreshold *decimal.Decimal // 余额预警线(低于此值触发通知)
|
||
Currency any // 货币(USD)
|
||
CreatedAt *gtime.Time // 创建时间
|
||
UpdatedAt *gtime.Time // 更新时间
|
||
CumulativeRecharge any // 累计充值总额(USD)
|
||
LowBalanceNotified any // 低余额预警是否已推送(充值恢复后重置为 false)
|
||
}
|