1、反向下单 暂时提交

This commit is contained in:
2025-07-26 09:09:09 +08:00
parent 3013486dd4
commit 771c617da4
44 changed files with 2018 additions and 614 deletions

View File

@ -21,7 +21,6 @@ import (
"github.com/bytedance/sonic"
"github.com/go-admin-team/go-admin-core/logger"
log "github.com/go-admin-team/go-admin-core/logger"
"github.com/shopspring/decimal"
"gorm.io/gorm"
)
@ -29,7 +28,7 @@ import (
/*
订单回调
*/
func ChangeSpotOrder(mapData map[string]interface{}) {
func ChangeSpotOrder(mapData map[string]interface{}, apiKey string) {
// 检查订单号是否存在
orderSn, ok := mapData["c"]
originOrderSn := mapData["C"] //取消操作 代表原始订单号
@ -193,7 +192,7 @@ func handleMainReduceFilled(db *gorm.DB, preOrder *DbModels.LinePreOrder) {
lock := helper.NewRedisLock(fmt.Sprintf(rediskey.SpotReduceCallback, preOrder.ApiId, preOrder.Symbol), 120, 20, 100*time.Millisecond)
if ok, err := lock.AcquireWait(context.Background()); err != nil {
log.Error("获取锁失败", err)
logger.Error("获取锁失败", err)
return
} else if ok {
defer lock.Release()