Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
dengli
2023-12-07 16:04:20 +08:00
4 changed files with 33 additions and 5 deletions

View File

@@ -33,7 +33,7 @@ public class QStockPO extends EntityPathBase<StockPO> {
public final StringPath stockCode = createString("stockCode");
public final NumberPath<Integer> 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<StockPO> {
public final NumberPath<Integer> stockState = createNumber("stockState", Integer.class);
public final NumberPath<Integer> stockSymbol = createNumber("stockSymbol", Integer.class);
public final StringPath stockSymbol = createString("stockSymbol");
public final StringPath stockType = createString("stockType");

View File

@@ -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())

View File

@@ -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);
}
/**
*

View File

@@ -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"})