| | |
| | | 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.*; |
| | |
| | | * Gate 配置控制面板 REST 接口。 |
| | | */ |
| | | @Slf4j |
| | | @ConditionalOnProperty(name = "app.gate.enabled", havingValue = "true", matchIfMissing = true) |
| | | @RestController |
| | | @RequestMapping("/api/gate") |
| | | @Api(tags = "Gate配置管理") |
| | |
| | | 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"); |
| | | } |
| | | |
| | | /** |