Merge branch 'develop' into 'main'

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

See merge request india/india_market_java!40
This commit is contained in:
Gavin g
2024-09-10 05:52:37 +00:00

View File

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