From 45db73ab04a7859e8c34d79b72218282670b5574 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 2 Aug 2024 13:30:15 +0800 Subject: [PATCH] 1 --- server/jccommon/constant.go | 1 + server/jccommon/transid.go | 2 +- server/marketserver/api/v1/recharge/recharge.go | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/jccommon/constant.go b/server/jccommon/constant.go index bae5a70e..db04a150 100644 --- a/server/jccommon/constant.go +++ b/server/jccommon/constant.go @@ -124,6 +124,7 @@ const ( ) const ( + TRANS_ID_EPOCH = 1643212800; TRANS_ID_MAX_FUNC_ID = 99 TRANS_ID_MAX_TIME = 999999999 TRANS_ID_MAX_SEQ_ID = 9999999 diff --git a/server/jccommon/transid.go b/server/jccommon/transid.go index a81076b6..f5775c11 100644 --- a/server/jccommon/transid.go +++ b/server/jccommon/transid.go @@ -24,7 +24,7 @@ type TransId struct { func (this *TransId) Init(funcId int32, time int32, seqId int32, params [3]int64) { this.funcId = funcId - this.time = time + this.time = time - TRANS_ID_EPOCH this.seqId = seqId this.params = params } diff --git a/server/marketserver/api/v1/recharge/recharge.go b/server/marketserver/api/v1/recharge/recharge.go index 842d863a..59c1d064 100644 --- a/server/marketserver/api/v1/recharge/recharge.go +++ b/server/marketserver/api/v1/recharge/recharge.go @@ -58,13 +58,14 @@ func (this *RechargeApi) Buy(c *gin.Context) { f5.RspErr(c, 2, "goods id param error") return } + nowTime := q5.ToInt32(f5.GetApp().GetRealSeconds()) shortOrderId := f5.GetApp().NewLockNodeUuid() orderId := "" { transId := jccommon.NewTransId() transId.Init( jccommon.TRANS_ID_FUNC_NORMAL, - 0, + nowTime, 0, [3]int64{ 0,