feat(REQ-4418) - 调整 testController 中的函数
This commit is contained in:
parent
99a300f2d5
commit
e83bdd6edb
@ -290,11 +290,15 @@ public class TestController {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
@GetMapping("log")
|
@GetMapping("log")
|
||||||
public String log(@RequestParam String keyword) throws Exception {
|
public String log(@RequestParam String keyword, @RequestParam(required = false) Date date, @RequestParam(required = false) String grepKeyword) throws Exception {
|
||||||
if (!StringUtils.hasText(keyword)) {
|
if (!StringUtils.hasText(keyword)) {
|
||||||
return "命令不能为空";
|
return "命令不能为空";
|
||||||
}
|
}
|
||||||
return ShellUtil.grepRealTimeLog(profile, keyword);
|
String s = ShellUtil.grepRealTimeLog(profile, keyword);
|
||||||
|
if (StringUtils.hasText(s)) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
return ShellUtil.grepLog(profile, keyword, Objects.isNull(date) ? new Date() : date, grepKeyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("form")
|
@GetMapping("form")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user