优化出参

This commit is contained in:
dengli
2023-12-16 19:24:18 +08:00
parent 7fd916a219
commit 5e8f90be10

View File

@@ -126,7 +126,6 @@ public class StockApiController {
@ResponseBody @ResponseBody
public ServerResponse getINDStockInfo(@RequestParam("stockCode") String stockCode) { public ServerResponse getINDStockInfo(@RequestParam("stockCode") String stockCode) {
ParamUtils.verify("股票代码", stockCode, ParamUtils.STRING_NOT_EMPTY_VERIFY_AND_CONVERT_VALUE); ParamUtils.verify("股票代码", stockCode, ParamUtils.STRING_NOT_EMPTY_VERIFY_AND_CONVERT_VALUE);
IndiaStockVO market = InvestingApis.of().market(StockCode.of(stockCode)); IndiaStockVO market = InvestingApis.of().market(StockCode.of(stockCode));
return ServerResponse.createBySuccess(market.toStockVo()); return ServerResponse.createBySuccess(market.toStockVo());
} }
@@ -188,15 +187,9 @@ public class StockApiController {
@ApiImplicitParam(name = "code",value = "股票对应代码symbol",dataType ="String",required = true), @ApiImplicitParam(name = "code",value = "股票对应代码symbol",dataType ="String",required = true),
}) })
public ServerResponse getSingleStock(@RequestParam("code") String code) { public ServerResponse getSingleStock(@RequestParam("code") String code) {
ServerResponse<Object> cache = null; return RequestCacheUtils.cache("getSingleStock.do", code, (string) -> {
try { return this.stockService.getSingleStock(code);
cache = RequestCacheUtils.cache("getSingleStock.do", code, (string) -> { });
return this.stockService.getSingleStock(code);
});
} catch (Exception e) {
return ServerResponse.createByErrorMsg("tips.msg.221");
}
return cache;
} }
@RequestMapping({"getMinK.do"}) @RequestMapping({"getMinK.do"})