Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
竹天卫
tianjin-cement
Commits
aff86ca4
Commit
aff86ca4
authored
Jan 19, 2021
by
shulidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标准查新手动脚本
parent
ba3488c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
ChinastdController.java
...ise/sc/cement/business/controller/ChinastdController.java
+19
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ChinastdController.java
View file @
aff86ca4
...
...
@@ -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,8 +123,22 @@ public class ChinastdController {
@PostMapping
(
"/run/sh"
)
@ApiOperation
(
"手动触发更新"
)
public
void
run
()
throws
IOException
{
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
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment