调整结构
This commit is contained in:
@@ -164,9 +164,9 @@ public class MoneyApiController {
|
||||
public ServerResponse getStockDetail(@RequestParam String stockType, @RequestParam String symbol ) {
|
||||
String url = String.format("https://priceapi.moneycontrol.com/pricefeed/%s/equitycash/%s",stockType,symbol);
|
||||
MoneyStock moneyStock = moneyStockRepository.findOne(QMoneyStockPO.moneyStockPO.stockType.eq(stockType).and(QMoneyStockPO.moneyStockPO.moneyScId.eq(symbol))).orElse(null);
|
||||
if(moneyStock==null){
|
||||
/* if(moneyStock==null){
|
||||
return ServerResponse.createByErrorMsg("没有找到该股票");
|
||||
}
|
||||
}*/
|
||||
// 设置重试次数
|
||||
int maxRetries = 3;
|
||||
for (int retry = 1; retry <= maxRetries; retry++) {
|
||||
@@ -189,8 +189,10 @@ public class MoneyApiController {
|
||||
json1.put("LTH",data.getString("LTH"));
|
||||
json1.put("LTL",data.getString("LTL"));
|
||||
json1.put("OPN",data.getString("OPN"));
|
||||
if(null!=moneyStock){
|
||||
json1.put("id",moneyStock.getId());
|
||||
}
|
||||
}
|
||||
return ServerResponse.createBySuccess(json1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user