From 6401fd39af5ab659f917cb0da1c2a79d45bcffca Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 23 Nov 2026 10:24:58 +0800
Subject: [PATCH] fix(gateApi): 忽略Gate配置反序列化未知属性
---
src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
index 962f697..b89d608 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
@@ -83,10 +83,12 @@
private Boolean tpTriggerOppositeAddEnabled;
/** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,0=不启用 */
private Integer tpTriggerOppositeAddQuantity;
- /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,支持小数,0=不启用 */
- private BigDecimal baseTakeProfitPerGrid;
- /** 止盈网格数量:基础仓位止盈挂单的网格数量,0=不启用 */
- private Integer baseTakeProfitGridCount;
+ /** 仓位止盈补仓开关:true=止盈触发时在对侧止损位挂同方向同张数开仓单,false=保持现有逻辑。null=未设置(默认false) */
+ private Boolean tpPositionReplenishEnabled;
+ /** 原始仓位止盈总数量:平均分配到对手盘止损位前的所有网格,余数挂最后一格,每格至少1张,0=不启用 */
+ private Integer baseTakeProfitTotalQty;
+ /** 原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长,默认 0 */
+ private Integer originalPositionReduce;
/**
* 从 GateConfig 构建 DTO(不暴露 apiSecret)。
@@ -126,8 +128,9 @@
.shortStopLossPrice(config.getShortStopLossPrice())
.tpTriggerOppositeAddEnabled(config.isTpTriggerOppositeAddEnabled())
.tpTriggerOppositeAddQuantity(config.getTpTriggerOppositeAddQuantity())
- .baseTakeProfitPerGrid(config.getBaseTakeProfitPerGrid())
- .baseTakeProfitGridCount(config.getBaseTakeProfitGridCount())
+ .tpPositionReplenishEnabled(config.isTpPositionReplenishEnabled())
+ .baseTakeProfitTotalQty(config.getBaseTakeProfitTotalQty())
+ .originalPositionReduce(config.getOriginalPositionReduce())
.build();
}
@@ -161,8 +164,9 @@
m.put("shortStopLossPrice", shortStopLossPrice);
m.put("tpTriggerOppositeAddEnabled", tpTriggerOppositeAddEnabled);
m.put("tpTriggerOppositeAddQuantity", tpTriggerOppositeAddQuantity);
- m.put("baseTakeProfitPerGrid", baseTakeProfitPerGrid);
- m.put("baseTakeProfitGridCount", baseTakeProfitGridCount);
+ m.put("tpPositionReplenishEnabled", tpPositionReplenishEnabled);
+ m.put("baseTakeProfitTotalQty", baseTakeProfitTotalQty);
+ m.put("originalPositionReduce", originalPositionReduce);
return m;
}
@@ -203,8 +207,9 @@
.shortStopLossPrice(null)
.tpTriggerOppositeAddEnabled(false)
.tpTriggerOppositeAddQuantity(0)
- .baseTakeProfitPerGrid(BigDecimal.ZERO)
- .baseTakeProfitGridCount(0)
+ .tpPositionReplenishEnabled(false)
+ .baseTakeProfitTotalQty(0)
+ .originalPositionReduce(0)
.build();
}
}
--
Gitblit v1.9.1