1
This commit is contained in:
parent
34a4edc901
commit
bc74af22b8
@ -49,7 +49,7 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *RechargeApi) Buy(c *gin.Context) {
|
func (this *RechargeApi) Buy(c *gin.Context) {
|
||||||
passportAddress := c.MustGet("account_address").(string)
|
passportAddress := mt.Table.Config.GetEmailBuyerPassportAddress()
|
||||||
reqJson := struct {
|
reqJson := struct {
|
||||||
NetId int32 `json:"net_id"`
|
NetId int32 `json:"net_id"`
|
||||||
GoodsId int32 `json:"goods_id"`
|
GoodsId int32 `json:"goods_id"`
|
||||||
@ -77,6 +77,10 @@ func (this *RechargeApi) BuyWithEmail(c *gin.Context) {
|
|||||||
f5.RspErr(c, 1, err.Error())
|
f5.RspErr(c, 1, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if reqJson.Email == "" {
|
||||||
|
f5.RspErr(c, 1, "email is empty")
|
||||||
|
return
|
||||||
|
}
|
||||||
this.internalBuy(c, reqJson.NetId, reqJson.GoodsId, reqJson.GoodsNum,
|
this.internalBuy(c, reqJson.NetId, reqJson.GoodsId, reqJson.GoodsNum,
|
||||||
reqJson.AccountAddress, passportAddress, reqJson.Email)
|
reqJson.AccountAddress, passportAddress, reqJson.Email)
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,10 @@ func (this *ConfigTable) GetJwksUri() string {
|
|||||||
return this.selfConf.GetJwksUri()
|
return this.selfConf.GetJwksUri()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *ConfigTable) GetEmailBuyerPassportAddress() string {
|
||||||
|
return this.selfConf.GetEmailBuyerPassportAddress()
|
||||||
|
}
|
||||||
|
|
||||||
func (this *ConfigTable) PostInit1() {
|
func (this *ConfigTable) PostInit1() {
|
||||||
this.selfConf = this.GetById(int64(0))
|
this.selfConf = this.GetById(int64(0))
|
||||||
if this.selfConf == nil {
|
if this.selfConf == nil {
|
||||||
|
@ -55,6 +55,7 @@ type GameDb struct {
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
gameapi_url string
|
gameapi_url string
|
||||||
jwks_uri string
|
jwks_uri string
|
||||||
|
email_buyer_passport_address string
|
||||||
|
|
||||||
_flags1_ uint64
|
_flags1_ uint64
|
||||||
_flags2_ uint64
|
_flags2_ uint64
|
||||||
@ -319,6 +320,14 @@ func (this *Config) HasJwksUri() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 2)) > 0
|
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 {
|
func (this *RechargeCurrency) GetCurrencyName() string {
|
||||||
return this.currency_name
|
return this.currency_name
|
||||||
}
|
}
|
||||||
@ -479,6 +488,7 @@ func (this *GameDb) LoadFromKv(kv map[string]interface{}) {
|
|||||||
func (this *Config) 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.gameapi_url, "gameapi_url", &this._flags1_, 1, kv)
|
||||||
f5.ReadMetaTableField(&this.jwks_uri, "jwks_uri", &this._flags1_, 2, 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{}) {
|
func (this *RechargeCurrency) LoadFromKv(kv map[string]interface{}) {
|
||||||
|
@ -46,6 +46,7 @@ message Config
|
|||||||
{
|
{
|
||||||
optional string gameapi_url = 1;
|
optional string gameapi_url = 1;
|
||||||
optional string jwks_uri = 2;
|
optional string jwks_uri = 2;
|
||||||
|
optional string email_buyer_passport_address = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RechargeCurrency
|
message RechargeCurrency
|
||||||
|
Loading…
x
Reference in New Issue
Block a user