优化出参

This commit is contained in:
dengli
2023-12-16 19:04:43 +08:00
parent 4f2bc4a4c6
commit e8cbf2c05e

View File

@@ -127,8 +127,10 @@ 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 = InvestingApis.of().market(StockCode.of(stockCode)); IndiaStockVO market = null;
if (market == null) { try {
market = InvestingApis.of().market(StockCode.of(stockCode));
} catch (Exception e) {
return ServerResponse.createByErrorMsg("tips.msg.221"); return ServerResponse.createByErrorMsg("tips.msg.221");
} }
return ServerResponse.createBySuccess(market.toStockVo()); return ServerResponse.createBySuccess(market.toStockVo());