refactor wallet domain management

This commit is contained in:
david
2026-07-28 09:25:49 +08:00
parent 8d71a1fc08
commit 8c6d52cf8c
20 changed files with 606 additions and 68 deletions

View File

@@ -10,12 +10,18 @@ import (
// Spec 是 Platform API 的运行配置。
var Spec SrvConfig
// WalletConfig 保存钱包后台资金操作限制。
type WalletConfig struct {
ManualRechargeMaxAmount int64 `yaml:"ManualRechargeMaxAmount"`
}
// SrvConfig 与 sample/server 配置结构保持一致。
type SrvConfig struct {
conf.Base `yaml:",inline"`
Databases *conf.DBConf `yaml:"Databases"`
Rpc map[string]conf.RpcConf `yaml:"Rpc"`
Apm *conf.ApmConf `yaml:"APM"`
Wallet WalletConfig `yaml:"Wallet"`
}
// New 初始化 BSM 配置并校验服务监听地址。
@@ -25,5 +31,8 @@ func New(srvKey string) {
Spec.BindIP = conf.CheckIP(Spec.BindIP)
Spec.Addr = net.JoinHostPort(Spec.BindIP, Spec.Port)
conf.NotNil(Spec.Service, Spec.Cache)
if Spec.Wallet.ManualRechargeMaxAmount <= 0 {
panic("Wallet.ManualRechargeMaxAmount must be greater than zero")
}
conf.PrintInfo(Spec.Addr)
}