1
This commit is contained in:
parent
81890d6374
commit
87e168be9d
@ -13,6 +13,11 @@ type RechargeCurrency struct {
|
|||||||
currencyDecimal int64
|
currencyDecimal int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RechargeCurrencyTable struct {
|
||||||
|
f5.CustomMetaTable
|
||||||
|
netIdHash *q5.ConcurrentMap[int64, *RechargeCurrency]
|
||||||
|
}
|
||||||
|
|
||||||
func (this *RechargeCurrency) init(currencyName string, exchangeRate int64, currencyDecimal int64) {
|
func (this *RechargeCurrency) init(currencyName string, exchangeRate int64, currencyDecimal int64) {
|
||||||
this.currencyName = currencyName
|
this.currencyName = currencyName
|
||||||
this.exchangeRate = exchangeRate
|
this.exchangeRate = exchangeRate
|
||||||
@ -31,11 +36,7 @@ func (this *RechargeCurrency) GetCurrencyDecimal() int64 {
|
|||||||
return this.currencyDecimal
|
return this.currencyDecimal
|
||||||
}
|
}
|
||||||
|
|
||||||
type RechargeCurrencyTable struct {
|
func (this *RechargeCurrency) check() {
|
||||||
f5.CustomMetaTable
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *RechargeCurrency) Init1() {
|
|
||||||
if this.GetExchangeRate() <= 0 {
|
if this.GetExchangeRate() <= 0 {
|
||||||
panic("RechargeCurrency exchange_rate <= 0")
|
panic("RechargeCurrency exchange_rate <= 0")
|
||||||
return
|
return
|
||||||
@ -59,6 +60,7 @@ func (this *RechargeCurrencyTable) Get(netId int32) *RechargeCurrency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *RechargeCurrencyTable) Load() {
|
func (this *RechargeCurrencyTable) Load() {
|
||||||
|
this.netIdHash = new(q5.ConcurrentMap[int64, *RechargeCurrency])
|
||||||
nets := []int64{}
|
nets := []int64{}
|
||||||
{
|
{
|
||||||
if jsonStr, err := f5.ReadJsonFile("../config/nets.json"); err == nil {
|
if jsonStr, err := f5.ReadJsonFile("../config/nets.json"); err == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user