From 1b55621d4dcf3b4ee6b9c4beb81ad69e5b7a5856 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 05 Jun 2026 17:58:08 +0800
Subject: [PATCH] refactor(okxNewPrice): 优化止损管理器的挂单数量计算逻辑
---
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java
index 46b5ac8..8d5329b 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java
@@ -229,6 +229,21 @@
if ("subscribe".equals(event) || "unsubscribe".equals(event)) {
log.info("[{}] {}事件: {}", logPrefix, event, response.getString("arg"));
+ // 订阅成功确认:解析频道名并通知对应 handler
+ if ("subscribe".equals(event)) {
+ JSONObject argObj = response.getJSONObject("arg");
+ if (argObj != null) {
+ String channel = argObj.getString("channel");
+ if (channel != null) {
+ for (OkxGridChannelHandler handler : channelHandlers) {
+ if (channel.equals(handler.getChannelName())) {
+ handler.onSubscribed();
+ break;
+ }
+ }
+ }
+ }
+ }
return;
}
--
Gitblit v1.9.1