This commit is contained in:
aozhiwei 2024-08-17 16:31:30 +08:00
parent 47f0dd43bb
commit cd06eeb3d7
4 changed files with 19 additions and 20 deletions

View File

@ -3,13 +3,14 @@
"id": 1001,
"diamond": 600,
"present_diamond": 66,
"price": 1,
"price": 6,
"max_buy_times": 1
},
{
"id": 1002,
"diamond": 6800,
"present_diamond": 1200,
"price": 68,
"max_buy_times": 68
},
{

View File

@ -46,13 +46,10 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
tmpmap := map[string]interface{}{}
tmpmap["goods_id"] = tb.GetId()
tmpmap["diamond"] = tb.GetDiamond()
tmpmap["present_diamond"] = tb.GetPresentDiamond()
tmpmap["price"] = tb.GetPrice()
tmpmap["max_buy_times"] = tb.GetMaxBuyTimes()
tmpmap["first_present_diamond"] = tb.GetFirstPresentDiamond()
tmpmap["is_first_recharge"] = 0
if ok, err := service.FirstRecharge.IsFirstRecharge(accountAddress, tb.GetId()); err == nil && ok {
tmpmap["is_first_recharge"] = 1
}
currencyList := []struct{
Name string `json:"name"`
Address string `json:"address"`

View File

@ -91,9 +91,9 @@ type Language struct {
type Recharge struct {
id int32
diamond int32
present_diamond int32
price int32
max_buy_times int32
first_present_diamond int32
_flags1_ uint64
_flags2_ uint64
@ -417,12 +417,20 @@ func (this *Recharge) HasDiamond() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *Recharge) GetPresentDiamond() int32 {
return this.present_diamond
}
func (this *Recharge) HasPresentDiamond() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *Recharge) GetPrice() int32 {
return this.price
}
func (this *Recharge) HasPrice() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
return (this._flags1_ & (uint64(1) << 4)) > 0
}
func (this *Recharge) GetMaxBuyTimes() int32 {
@ -430,14 +438,6 @@ func (this *Recharge) GetMaxBuyTimes() int32 {
}
func (this *Recharge) HasMaxBuyTimes() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0
}
func (this *Recharge) GetFirstPresentDiamond() int32 {
return this.first_present_diamond
}
func (this *Recharge) HasFirstPresentDiamond() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
@ -521,9 +521,9 @@ func (this *Language) LoadFromKv(kv map[string]interface{}) {
func (this *Recharge) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.id, "id", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.diamond, "diamond", &this._flags1_, 2, kv)
f5.ReadMetaTableField(&this.price, "price", &this._flags1_, 3, kv)
f5.ReadMetaTableField(&this.max_buy_times, "max_buy_times", &this._flags1_, 4, kv)
f5.ReadMetaTableField(&this.first_present_diamond, "first_present_diamond", &this._flags1_, 5, kv)
f5.ReadMetaTableField(&this.present_diamond, "present_diamond", &this._flags1_, 3, kv)
f5.ReadMetaTableField(&this.price, "price", &this._flags1_, 4, kv)
f5.ReadMetaTableField(&this.max_buy_times, "max_buy_times", &this._flags1_, 5, kv)
}
func (this *Web3ServiceCluster) LoadFromKv(kv map[string]interface{}) {

View File

@ -74,8 +74,9 @@ message Recharge
{
optional int32 id = 1;
optional int32 diamond = 2;
optional int32 price = 3;
optional int32 max_buy_times = 4;
optional int32 present_diamond = 3;
optional int32 price = 4;
optional int32 max_buy_times = 5;
}
message Web3ServiceCluster