From e9f583d2001eddac955a830405519fdfbabc059c Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 30 Sep 2026 16:42:16 +0800
Subject: [PATCH] feat(gateApi): 添加基础仓位止盈网格功能

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateConfigController.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigController.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigController.java
index bd9d90c..8d17b05 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigController.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigController.java
@@ -4,6 +4,7 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
@@ -13,6 +14,7 @@
  * Gate 配置控制面板 REST 接口。
  */
 @Slf4j
+@ConditionalOnProperty(name = "app.gate.enabled", havingValue = "true", matchIfMissing = true)
 @RestController
 @RequestMapping("/api/gate")
 @Api(tags = "Gate配置管理")
@@ -38,7 +40,7 @@
         }
         GateConfigDTO dto = persistenceService.load(apiKey);
         if (dto == null) {
-            dto = new GateConfigDTO();
+            return Result.fail("apiKey 错误,未找到该配置");
         }
         dto.setApiKey(apiKey);
         return Result.ok(dto);
@@ -102,9 +104,9 @@
     public Result getStatus() {
         GateGridTradeService service = clientManager.getGridTradeService();
         if (service == null) {
-            return Result.ok("STOPPED");
+            return Result.ok("success", "STOPPED");
         }
-        return Result.ok(service.isStrategyActive() ? "ACTIVE" : "STOPPED");
+        return Result.ok("success", service.isStrategyActive() ? "ACTIVE" : "STOPPED");
     }
 
     /**

--
Gitblit v1.9.1