Commit 063439e4 authored by 竹天卫's avatar 竹天卫

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	cement-business/src/main/java/cn/wise/sc/cement/business/controller/ChinastdController.java
parents bd8d78b9 3df190d9
......@@ -27,7 +27,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
/**
......@@ -120,9 +123,22 @@ public class ChinastdController {
@PostMapping("/run/sh")
@ApiOperation("手动触发更新")
public void run() throws IOException {
System.out.println("************标准查新************");
final String shUrl = "/usr/bin/python3 /opt/chinastd_spider.py";
Runtime.getRuntime().exec(shUrl);
/*final String shUrl = "/usr/bin/python3 /opt/chinastd_spider.py";
Runtime.getRuntime().exec(shUrl);*/
try {
Process pro = Runtime.getRuntime().exec("/opt/chinastd_spider.sh");
InputStream in = pro.getInputStream();
BufferedReader read = new BufferedReader(new InputStreamReader(in));
String line = null;
while((line = read.readLine())!=null){
System.out.println("#################标准查新"+line);
}
pro.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment