优化出参

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