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

This commit is contained in:
gavin
2024-09-10 13:11:01 +08:00
parent 5ae9762d45
commit 94d9aea2c8

View File

@@ -222,6 +222,7 @@ public class MoneyApiController {
json1.put("pricecurrent", data.getString("priceprevclose"));
}
}
if (json1.size() > 0)
return ServerResponse.createBySuccess(json1);
}
} catch (Exception e) {
@@ -252,7 +253,6 @@ public class MoneyApiController {
}
private static List<MoneyStockSuggestDTO> nseActives() {
List<MoneyStockSuggestDTO> list = new ArrayList<>();
String url = "https://www.moneycontrol.com/stocks/marketstats/nse-mostactive-stocks/nifty-50-9/";
@@ -521,8 +521,6 @@ public class MoneyApiController {
}
@ApiOperation(value = "股票推荐TopGainer", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "stockType", value = "BSE或者NSE"),
@@ -619,8 +617,6 @@ public class MoneyApiController {
}
@ApiOperation(value = "股票推荐TopActive", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "stockType", value = "BSE或者NSE"),
@@ -673,7 +669,6 @@ public class MoneyApiController {
}
@GetMapping({"/market/api/market/money/history/kLine", "/api/market/money/history/kLine"})
@ApiOperation(value = "获取kline的money数据源", notes = "获取kline的money数据源", response = StockHistoryResponse.class)
@ApiImplicitParams({
@@ -802,14 +797,14 @@ public class MoneyApiController {
}
private String buildApiUrl(StockHistoryRequest request) {
// 构建外部API的URL
return String.format("%s?symbol=%s&resolution=%s&from=%d&to=%d&countback=%d&currencyCode=%s",
EXTERNAL_API_URL, request.getSymbol(), request.getResolution(), request.getFrom(),
request.getTo(), request.getCountback(), request.getCurrencyCode());
};
}
;
private static String extractLastSegment(String url) {