This commit is contained in:
aozhiwei 2024-08-02 13:23:07 +08:00
parent b7c6cda3dc
commit 67208ab3bd
4 changed files with 32 additions and 10 deletions

View File

@ -130,3 +130,7 @@ const (
TRANS_ID_MIN_LEN = 77
TRANS_ID_MAX_LEN = 78
)
const (
TRANS_ID_FUNC_NORMAL = 1
)

View File

@ -43,7 +43,7 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
func (this *RechargeApi) Buy(c *gin.Context) {
reqJson := struct {
NetId int32 `json:"net_id"`
GoodsId string `json:"goods_id"`
GoodsId int32 `json:"goods_id"`
AccountAddress string `json:"account_address"`
}{}
if err := c.ShouldBindJSON(&reqJson); err != nil {
@ -58,8 +58,26 @@ func (this *RechargeApi) Buy(c *gin.Context) {
f5.RspErr(c, 2, "goods id param error")
return
}
shortOrderId := q5.ToString(f5.GetApp().NewLockNodeUuid())
orderId := q5.ToString(shortOrderId)
shortOrderId := f5.GetApp().NewLockNodeUuid()
orderId := ""
{
transId := jccommon.NewTransId()
transId.Init(
jccommon.TRANS_ID_FUNC_NORMAL,
0,
0,
[3]int64{
0,
0,
shortOrderId,
})
var err error
orderId, err = transId.ToString()
if err != nil {
f5.RspErr(c, 2, "server internal error")
return
}
}
params := map[string]string{
"c": "BcService",
"a": "recharge",

View File

@ -84,7 +84,7 @@ type Recharge struct {
recharge_item int32
recharge_type int32
recharge_item_num int32
id string
id int32
recharge_currency string
_flags1_ uint64
@ -401,7 +401,7 @@ func (this *Recharge) HasRechargeItemNum() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *Recharge) GetId() string {
func (this *Recharge) GetId() int32 {
return this.id
}

View File

@ -65,11 +65,11 @@ message Language
message Recharge
{
optional string recharge_cost_num = 1;
optional string recharge_icon =2;
optional int32 recharge_item =3;
optional int32 recharge_type =4;
optional int32 recharge_item_num =5;
optional string id =6;
optional string recharge_icon =2;
optional int32 recharge_item =3;
optional int32 recharge_type =4;
optional int32 recharge_item_num =5;
optional int32 id =6;
optional string recharge_currency = 7;
}