|
@@ -1,5 +1,6 @@
|
|
|
package cn.reghao.autodop.dmaster.sys.controller;
|
|
package cn.reghao.autodop.dmaster.sys.controller;
|
|
|
|
|
|
|
|
|
|
+import cn.reghao.autodop.dmaster.sys.db.MongoQuery;
|
|
|
import cn.reghao.autodop.dmaster.sys.entity.AppRuntimeLog;
|
|
import cn.reghao.autodop.dmaster.sys.entity.AppRuntimeLog;
|
|
|
import cn.reghao.autodop.dmaster.sys.repository.AppRuntimeLogRepository;
|
|
import cn.reghao.autodop.dmaster.sys.repository.AppRuntimeLogRepository;
|
|
|
import cn.reghao.autodop.dmaster.utils.db.PageList;
|
|
import cn.reghao.autodop.dmaster.utils.db.PageList;
|
|
@@ -21,22 +22,32 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@RequestMapping("/sys/log")
|
|
@RequestMapping("/sys/log")
|
|
|
@Controller
|
|
@Controller
|
|
|
public class SysLogPageController {
|
|
public class SysLogPageController {
|
|
|
|
|
+ private MongoQuery mongoQuery;
|
|
|
private AppRuntimeLogRepository runtimeLogRepository;
|
|
private AppRuntimeLogRepository runtimeLogRepository;
|
|
|
|
|
|
|
|
- public SysLogPageController(AppRuntimeLogRepository runtimeLogRepository) {
|
|
|
|
|
|
|
+ public SysLogPageController(MongoQuery mongoQuery, AppRuntimeLogRepository runtimeLogRepository) {
|
|
|
|
|
+ this.mongoQuery = mongoQuery;
|
|
|
this.runtimeLogRepository = runtimeLogRepository;
|
|
this.runtimeLogRepository = runtimeLogRepository;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "运行日志页面")
|
|
@ApiOperation(value = "运行日志页面")
|
|
|
- @GetMapping("/running")
|
|
|
|
|
- public String runningLogPage(Model model) {
|
|
|
|
|
|
|
+ @GetMapping("/runtime")
|
|
|
|
|
+ public String runtimeLogPage(Model model) {
|
|
|
|
|
+ mongoQuery.aggregate("AppRuntimeLog");
|
|
|
|
|
+
|
|
|
PageRequest pageRequest = PageSort.pageRequest("createTime", Sort.Direction.DESC);
|
|
PageRequest pageRequest = PageSort.pageRequest("createTime", Sort.Direction.DESC);
|
|
|
Page<AppRuntimeLog> page = runtimeLogRepository.findAll(pageRequest);
|
|
Page<AppRuntimeLog> page = runtimeLogRepository.findAll(pageRequest);
|
|
|
PageList<AppRuntimeLog> pageList = PageList.pageList(page);
|
|
PageList<AppRuntimeLog> pageList = PageList.pageList(page);
|
|
|
|
|
|
|
|
model.addAttribute("page", page);
|
|
model.addAttribute("page", page);
|
|
|
model.addAttribute("list", pageList.getList());
|
|
model.addAttribute("list", pageList.getList());
|
|
|
- return "/sys/log/running";
|
|
|
|
|
|
|
+ return "/sys/log/runtime";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "运行日志详情页面")
|
|
|
|
|
+ @GetMapping("/runtime/detail/{id}")
|
|
|
|
|
+ public String runtimeLogDeatilPage(@PathVariable("id") String id, Model model) {
|
|
|
|
|
+ return "/sys/log/rtdetail";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "访问日志页面")
|
|
@ApiOperation(value = "访问日志页面")
|
|
@@ -48,6 +59,6 @@ public class SysLogPageController {
|
|
|
|
|
|
|
|
model.addAttribute("page", page);
|
|
model.addAttribute("page", page);
|
|
|
model.addAttribute("list", pageList.getList());
|
|
model.addAttribute("list", pageList.getList());
|
|
|
- return "/sys/log/running";
|
|
|
|
|
|
|
+ return "/sys/log/access";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|