feat(v2): 多币种 product(ProductPrice 分币价目 + v1 元回退)+ 结算币种由渠道能力驱动

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
wangjia
2026-07-10 14:20:12 +08:00
parent abf6a43b8c
commit 585133532c
8 changed files with 128 additions and 54 deletions
+2 -1
View File
@@ -50,7 +50,7 @@ func main() {
return o.Status == model.OrderPaidV2, nil
})
notifier.Start(60 * time.Second)
productResolver := gateway.NewDBProductResolver(db, "CNY") // 币种按部署区配(cn=CNY / global=USDT)
productResolver := gateway.NewDBProductResolver(db) // 币种由下单渠道结算能力驱动(设计 §4.1)
acctReg := accounts.New(config.C.Accounts)
// P5 多账户路由:按 config.routing.<channel> 选策略(缺省 round_robin)。
// limit_aware 用量数据源 P6 对账就绪前用空源(NopUsage,退化为 round_robin)。
@@ -103,6 +103,7 @@ func autoMigrate(db *gorm.DB) {
if err := db.AutoMigrate(
&model.Merchant{},
&model.Product{},
&model.ProductPrice{},
&model.Order{},
&model.NotifyLog{},
&model.BizNotifyLog{},