This commit is contained in:
aozhiwei 2024-08-13 15:35:02 +08:00
parent 34a4edc901
commit bc74af22b8
4 changed files with 20 additions and 1 deletions

View File

@ -49,7 +49,7 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
}
func (this *RechargeApi) Buy(c *gin.Context) {
passportAddress := c.MustGet("account_address").(string)
passportAddress := mt.Table.Config.GetEmailBuyerPassportAddress()
reqJson := struct {
NetId int32 `json:"net_id"`
GoodsId int32 `json:"goods_id"`
@ -77,6 +77,10 @@ func (this *RechargeApi) BuyWithEmail(c *gin.Context) {
f5.RspErr(c, 1, err.Error())
return
}
if reqJson.Email == "" {
f5.RspErr(c, 1, "email is empty")
return
}
this.internalBuy(c, reqJson.NetId, reqJson.GoodsId, reqJson.GoodsNum,
reqJson.AccountAddress, passportAddress, reqJson.Email)
}

View File

@ -22,6 +22,10 @@ func (this *ConfigTable) GetJwksUri() string {
return this.selfConf.GetJwksUri()
}
func (this *ConfigTable) GetEmailBuyerPassportAddress() string {
return this.selfConf.GetEmailBuyerPassportAddress()
}
func (this *ConfigTable) PostInit1() {
this.selfConf = this.GetById(int64(0))
if this.selfConf == nil {

View File

@ -55,6 +55,7 @@ type GameDb struct {
type Config struct {
gameapi_url string
jwks_uri string
email_buyer_passport_address string
_flags1_ uint64
_flags2_ uint64
@ -319,6 +320,14 @@ func (this *Config) HasJwksUri() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *Config) GetEmailBuyerPassportAddress() string {
return this.email_buyer_passport_address
}
func (this *Config) HasEmailBuyerPassportAddress() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *RechargeCurrency) GetCurrencyName() string {
return this.currency_name
}
@ -479,6 +488,7 @@ func (this *GameDb) LoadFromKv(kv map[string]interface{}) {
func (this *Config) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.gameapi_url, "gameapi_url", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.jwks_uri, "jwks_uri", &this._flags1_, 2, kv)
f5.ReadMetaTableField(&this.email_buyer_passport_address, "email_buyer_passport_address", &this._flags1_, 3, kv)
}
func (this *RechargeCurrency) LoadFromKv(kv map[string]interface{}) {

View File

@ -46,6 +46,7 @@ message Config
{
optional string gameapi_url = 1;
optional string jwks_uri = 2;
optional string email_buyer_passport_address = 3;
}
message RechargeCurrency