refactor wallet domain management
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user