From 9eed388bf3c07dc0ea24fb0637b4964c8e387437 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 22 Dec 2025 16:45:43 +0800
Subject: [PATCH] fix(symbols): 修复K线数据获取逻辑
---
src/main/java/com/xcong/excoin/modules/newPrice/impl/ExchangeLoginEventServiceImpl.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/newPrice/impl/ExchangeLoginEventServiceImpl.java b/src/main/java/com/xcong/excoin/modules/newPrice/impl/ExchangeLoginEventServiceImpl.java
new file mode 100644
index 0000000..b9def41
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/newPrice/impl/ExchangeLoginEventServiceImpl.java
@@ -0,0 +1,50 @@
+package com.xcong.excoin.modules.newPrice.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xcong.excoin.modules.newPrice.ExchangeLoginEventService;
+import com.xcong.excoin.modules.newPrice.OKXAccount;
+import com.xcong.excoin.modules.newPrice.enums.DefaultUrls;
+import com.xcong.excoin.modules.newPrice.enums.HttpMethod;
+import com.xcong.excoin.modules.newPrice.utils.OKXContants;
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+
+@Slf4j
+public class ExchangeLoginEventServiceImpl implements ExchangeLoginEventService {
+
+
+ private final com.xcong.excoin.modules.newPrice.OKXAccount OKXAccount;
+ private final String apiKey;
+ private final String secretKey;
+ private final String passphrase;
+ private final boolean accountType;
+
+ public ExchangeLoginEventServiceImpl(String apiKey, String secretKey, String passphrase, boolean accountType) {
+ this.apiKey = apiKey;
+ this.secretKey = secretKey;
+ this.passphrase = passphrase;
+ this.accountType = accountType;
+ OKXAccount = new OKXAccount(
+ accountType ? DefaultUrls.USDM_PROD_URL : DefaultUrls.USDM_UAT_URL,
+ apiKey,
+ secretKey,
+ passphrase,
+ !accountType);
+ }
+
+ @Override
+ public String exchangeInfo(LinkedHashMap<String, Object> parameters) {
+ return OKXAccount.requestHandler.sendPublicRequest(OKXAccount.baseUrl, OKXContants.INSTRUMENTS,parameters, HttpMethod.GET, OKXAccount.isSimluate());
+ }
+
+ @Override
+ public String lineHistory(LinkedHashMap<String, Object> parameters) {
+ return OKXAccount.requestHandler.sendPublicRequest(OKXAccount.baseUrl, OKXContants.K_LINE_HISTORY,parameters, HttpMethod.GET, OKXAccount.isSimluate());
+ }
+
+}
--
Gitblit v1.9.1