指定股票更换详情测试代码

This commit is contained in:
gavin
2024-09-09 14:59:38 +08:00
parent ece52491dd
commit 5ae9762d45

View File

@@ -177,6 +177,19 @@ public class MoneyApiController {
return ServerResponse.createByErrorMsg("没有找到该股票"); return ServerResponse.createByErrorMsg("没有找到该股票");
}*/ }*/
// 设置重试次数 // 设置重试次数
if("ANI".equals(symbol)){
JSONObject json1 = new JSONObject();
json1.put("company","Archit Nuwood Industries Ltd");
json1.put("pricepercentchange","Archit Nuwood Industries Ltd");
json1.put("stockType",stockType);
json1.put("pricecurrent","386");
json1.put("dataSourceType","3");
json1.put("symbol","ANI");
json1.put("BSEID","ANI");
json1.put("NSEID","ANI");
return ServerResponse.createBySuccess(json1);
}
String url = String.format("https://priceapi.moneycontrol.com/pricefeed/%s/equitycash/%s",stockType,symbol); String url = String.format("https://priceapi.moneycontrol.com/pricefeed/%s/equitycash/%s",stockType,symbol);
int maxRetries = 3; int maxRetries = 3;
for (int retry = 1; retry <= maxRetries; retry++) { for (int retry = 1; retry <= maxRetries; retry++) {