feat(REQ-4418) - 调整 testController 中的函数

This commit is contained in:
wangli 2025-08-27 14:16:06 +08:00
parent 99a300f2d5
commit e83bdd6edb

View File

@ -290,11 +290,15 @@ public class TestController {
}*/
@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)) {
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")