diff --git a/src/main/generated/cn/stock/market/infrastructure/db/po/QStockPO.java b/src/main/generated/cn/stock/market/infrastructure/db/po/QStockPO.java index 90be42c..79fce48 100644 --- a/src/main/generated/cn/stock/market/infrastructure/db/po/QStockPO.java +++ b/src/main/generated/cn/stock/market/infrastructure/db/po/QStockPO.java @@ -33,7 +33,7 @@ public class QStockPO extends EntityPathBase { public final StringPath stockCode = createString("stockCode"); - public final NumberPath stockExchangeId = createNumber("stockExchangeId", Integer.class); + public final StringPath stockExchangeId = createString("stockExchangeId"); public final StringPath stockGid = createString("stockGid"); @@ -45,7 +45,7 @@ public class QStockPO extends EntityPathBase { public final NumberPath stockState = createNumber("stockState", Integer.class); - public final NumberPath stockSymbol = createNumber("stockSymbol", Integer.class); + public final StringPath stockSymbol = createString("stockSymbol"); public final StringPath stockType = createString("stockType"); diff --git a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingApis.java b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingApis.java index d53a99f..0720def 100644 --- a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingApis.java +++ b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingApis.java @@ -62,6 +62,7 @@ public class InvestingApis { vo.setName(pair_name_base); vo.setCname(pair_name_base); vo.setCode(pair_ID); + vo.setTargetId(pair_ID); String 昨收 = find_overview_table_value_with_key(overview_table, "昨收"); vo.setClose(numberToString(昨收)); @@ -243,9 +244,9 @@ public class InvestingApis { item.put("volume", _ar.get(5)); return item; }).filter(val -> { -// if("min".equalsIgnoreCase(string)) { -// return DateUtil.isSameDay(nowDate, new Date(val.getLong("date"))); -// } + if("min".equalsIgnoreCase(string)) { + return DateUtil.isSameDay(nowDate, new Date(val.getLong("date"))); + } return true; }) .collect(Collectors.toList()) diff --git a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java index f8fbf3d..5627b1c 100644 --- a/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java +++ b/src/main/java/cn/stock/market/infrastructure/api/investing/InvestingInvokerApis.java @@ -125,6 +125,26 @@ public class InvestingInvokerApis { log.info("第{}页码, 耗时: {} 毫秒, 返回原始值: {}, 准备解析中.", pageNum, stopwatch.elapsed(TimeUnit.MILLISECONDS), body); return JSON.parseObject(body); } + + /** + * 与 __page 的区别 + * api/financialdata/assets/equitiesByCountry/default + * api/financialdata/assets/equitiesByCountry/17943 + * @param pageNum + * @param pageSize + * @return + * @throws IOException + */ + public JSONObject __page_nifty100(int pageNum, int pageSize) throws IOException { + String tmpl = "https://api.investing.com/api/financialdata/assets/equitiesByCountry/17943?fields-list=id,name,symbol,high,low,last,lastPairDecimal,change,changePercent,volume,time,isOpen,url,flag,countryNameTranslated,exchangeId,performanceDay,performanceWeek,performanceMonth,performanceYtd,performanceYear,performance3Year,technicalHour,technicalDay,technicalWeek,technicalMonth,avgVolume,fundamentalMarketCap,fundamentalRevenue,fundamentalRatio,fundamentalBeta,pairType&country-id=14&page={}&page-size={}&include-major-indices=false&include-additional-indices=false&include-primary-sectors=false&include-other-indices=false&limit=0"; + String url = StrFormatter.format(tmpl, pageNum, pageSize); + Stopwatch stopwatch = Stopwatch.createStarted(); + log.info("url: {}", url); + Builder builder = builderGet(url); + String body = httpClient().newCall(builder.build()).execute().body().string(); + log.info("第{}页码, 耗时: {} 毫秒, 返回原始值: {}, 准备解析中.", pageNum, stopwatch.elapsed(TimeUnit.MILLISECONDS), body); + return JSON.parseObject(body); + } /** * diff --git a/src/main/java/cn/stock/market/web/StockApiController.java b/src/main/java/cn/stock/market/web/StockApiController.java index b259023..9b5f462 100644 --- a/src/main/java/cn/stock/market/web/StockApiController.java +++ b/src/main/java/cn/stock/market/web/StockApiController.java @@ -137,6 +137,13 @@ public class StockApiController { public ServerResponse getINDStockList(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) throws IOException { return ServerResponse.createBySuccess(InvestingInvokerApis.of().__page(pageNum, pageSize)); } + + @RequestMapping({"getTopINDStockList.do"}) + @ApiOperation(value = "印度热门股票列表", httpMethod = "GET") + @ResponseBody + public ServerResponse getTopINDStockList(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) throws IOException { + return ServerResponse.createBySuccess(InvestingInvokerApis.of().__page_nifty100(pageNum, pageSize)); + } //印度股票时线-K线 @RequestMapping({"getINDTimeK.do"})