From cb0eefdc3573b633f18f242abe30f3a9b94e6153 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 14 Mar 2022 18:00:27 +0800
Subject: [PATCH] 20222223

---
 src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java b/src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java
index 55b6f5c..afae70f 100644
--- a/src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java
+++ b/src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java
@@ -1,10 +1,13 @@
 package com.xcong.excoin.modules.symbols.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.huobi.client.model.Candlestick;
 import com.xcong.excoin.common.response.Result;
 import com.xcong.excoin.modules.symbols.parameter.dto.KlineDetailDto;
 import com.xcong.excoin.modules.symbols.parameter.vo.HomeSymbolsVo;
 import com.xcong.excoin.modules.symbols.parameter.vo.KlineDataVo;
 import com.xcong.excoin.modules.symbols.service.SymbolsService;
+import com.xcong.excoin.utils.RedisUtils;
 import com.xcong.excoin.utils.TypeJudgeUtils;
 import io.swagger.annotations.*;
 import lombok.extern.slf4j.Slf4j;
@@ -26,12 +29,15 @@
     @Resource
     private SymbolsService symbolsService;
 
+    @Resource
+    private RedisUtils redisUtils;
+
     @ApiOperation(value = "轮询获取app首页币种交易信息", notes = "轮询获取app首页币种交易信息")
     @ApiResponses({
             @ApiResponse(code = 0, message = "success", response = HomeSymbolsVo.class)
     })
     @GetMapping(value = "/homeSymbols")
-    public Result homeSymbols(@ApiParam(name = "type", value = "类型1-币币2-合约3-自选", required = true, example = "1") Integer type) {
+    public Result homeSymbols(@ApiParam(name = "type", value = "类型1-币币2-合约3-自选", required = true, example = "1") @RequestParam(value = "type") Integer type) {
         return symbolsService.homeSymbols(type);
     }
 
@@ -40,7 +46,7 @@
             @ApiResponse(code = 0, message = "success", response = HomeSymbolsVo.class)
     })
     @GetMapping(value = "/findSymbolData")
-    public Result findSymbolData(@ApiParam(name = "symbol", value = "币种", required = true, example = "BTC/USDT") String symbol) {
+    public Result findSymbolData(@ApiParam(name = "symbol", value = "币种", required = true, example = "BTC/USDT") @RequestParam(value = "symbol") String symbol) {
         return symbolsService.findSymbolData(symbol);
     }
 
@@ -53,8 +59,14 @@
         if (!TypeJudgeUtils.klinePeriod(klineDetailDto.getPeriod())) {
             return Result.fail("非法参数");
         }
-
         return symbolsService.findKlineDetails(klineDetailDto);
     }
 
+    @ApiOperation(value = "查询当日最高最低价")
+    @GetMapping(value = "/getDayHighAndLow")
+    public Result getDayHighAndLow(@ApiParam(name = "symbol", value = "币种", required = true, example = "BTC/USDT") @RequestParam(value = "symbol") String symbol) {
+        Candlestick object = (Candlestick) redisUtils.get(symbol);
+        return Result.ok(object);
+    }
+
 }

--
Gitblit v1.9.1