This commit is contained in:
aozhiwei 2024-08-02 13:30:15 +08:00
parent 4440e24db7
commit 45db73ab04
3 changed files with 4 additions and 2 deletions

View File

@ -124,6 +124,7 @@ const (
) )
const ( const (
TRANS_ID_EPOCH = 1643212800;
TRANS_ID_MAX_FUNC_ID = 99 TRANS_ID_MAX_FUNC_ID = 99
TRANS_ID_MAX_TIME = 999999999 TRANS_ID_MAX_TIME = 999999999
TRANS_ID_MAX_SEQ_ID = 9999999 TRANS_ID_MAX_SEQ_ID = 9999999

View File

@ -24,7 +24,7 @@ type TransId struct {
func (this *TransId) Init(funcId int32, time int32, seqId int32, params [3]int64) { func (this *TransId) Init(funcId int32, time int32, seqId int32, params [3]int64) {
this.funcId = funcId this.funcId = funcId
this.time = time this.time = time - TRANS_ID_EPOCH
this.seqId = seqId this.seqId = seqId
this.params = params this.params = params
} }

View File

@ -58,13 +58,14 @@ func (this *RechargeApi) Buy(c *gin.Context) {
f5.RspErr(c, 2, "goods id param error") f5.RspErr(c, 2, "goods id param error")
return return
} }
nowTime := q5.ToInt32(f5.GetApp().GetRealSeconds())
shortOrderId := f5.GetApp().NewLockNodeUuid() shortOrderId := f5.GetApp().NewLockNodeUuid()
orderId := "" orderId := ""
{ {
transId := jccommon.NewTransId() transId := jccommon.NewTransId()
transId.Init( transId.Init(
jccommon.TRANS_ID_FUNC_NORMAL, jccommon.TRANS_ID_FUNC_NORMAL,
0, nowTime,
0, 0,
[3]int64{ [3]int64{
0, 0,