优化出参
This commit is contained in:
@@ -127,12 +127,7 @@ public class StockApiController {
|
|||||||
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 = null;
|
IndiaStockVO market = InvestingApis.of().market(StockCode.of(stockCode));
|
||||||
try {
|
|
||||||
market = InvestingApis.of().market(StockCode.of(stockCode));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return ServerResponse.createByErrorMsg("tips.msg.221");
|
|
||||||
}
|
|
||||||
return ServerResponse.createBySuccess(market.toStockVo());
|
return ServerResponse.createBySuccess(market.toStockVo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,9 +188,15 @@ 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) {
|
||||||
return RequestCacheUtils.cache("getSingleStock.do", code, (string) -> {
|
ServerResponse<Object> cache = null;
|
||||||
|
try {
|
||||||
|
cache = RequestCacheUtils.cache("getSingleStock.do", code, (string) -> {
|
||||||
return this.stockService.getSingleStock(code);
|
return this.stockService.getSingleStock(code);
|
||||||
});
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ServerResponse.createByErrorMsg("tips.msg.221");
|
||||||
|
}
|
||||||
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping({"getMinK.do"})
|
@RequestMapping({"getMinK.do"})
|
||||||
|
|||||||
Reference in New Issue
Block a user