| | |
| | | private XchProfitService xchProfitService; |
| | | |
| | | // @Scheduled(cron = "0 0 0/10 * * ? ") |
| | | @Scheduled(cron = "0 0/20 * * * ? ") |
| | | @Scheduled(cron = "0 0/10 * * * ? ") |
| | | public void baseDataUpdate() { |
| | | log.info("基础数据更新任务"); |
| | | // 请求价格等数据 "https://api2.chiaexplorer.com/blockchainSummary" |
| | | String result = pyExec(); |
| | | log.info("result======>>{}", result); |
| | | // 每t预计收益 |
| | | // String profitPerT = execCurl("https://api2.chiaexplorer.com/chart/xchTibDay?period=2w"); |
| | | // |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | |
| | | // System.out.println(HttpRequest.get("https://www.chiaexplorer.com").execute().body()); |
| | | // System.out.println(execCurl(cmds)); |
| | | } |
| | |
| | | String path = ClassUtils.getDefaultClassLoader().getResource("").getPath(); |
| | | String filePath = path + "static/xch.py"; |
| | | try { |
| | | Process process = Runtime.getRuntime().exec("python3 " + filePath); |
| | | Process process = Runtime.getRuntime().exec("python2.7 " + filePath); |
| | | process.waitFor(); |
| | | InputStreamReader ir = new InputStreamReader(process.getInputStream()); |
| | | LineNumberReader input = new LineNumberReader(ir); |