|
|
@@ -2,6 +2,8 @@ package cn.reghao.devops.manager.app.controller;
|
|
|
|
|
|
import cn.reghao.devops.common.msg.constant.AppStatOps;
|
|
|
import cn.reghao.devops.manager.app.service.bd.AppStat;
|
|
|
+import cn.reghao.devops.manager.log.model.vo.AppLogVO;
|
|
|
+import cn.reghao.devops.manager.log.service.LogService;
|
|
|
import cn.reghao.jutil.jdk.result.Result;
|
|
|
import cn.reghao.jutil.jdk.result.ResultStatus;
|
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
|
@@ -11,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @author reghao
|
|
|
* @date 2020-02-28 11:33:23
|
|
|
@@ -21,9 +25,11 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@RequestMapping("/api/app/status")
|
|
|
public class AppStatusController {
|
|
|
private final AppStat statusService;
|
|
|
+ private final LogService logService;
|
|
|
|
|
|
- public AppStatusController(AppStat statusService) {
|
|
|
+ public AppStatusController(AppStat statusService, LogService logService) {
|
|
|
this.statusService = statusService;
|
|
|
+ this.logService = logService;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "重启应用")
|
|
|
@@ -54,4 +60,11 @@ public class AppStatusController {
|
|
|
String msg = String.format("正在获取 %s 的状态,请 10s 后刷新页面查看", appId);
|
|
|
return WebResult.result(Result.result(ResultStatus.SUCCESS, msg));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "应用历史日志")
|
|
|
+ @GetMapping(value = "/log", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public String getAppLog() {
|
|
|
+ List<AppLogVO> list = logService.getAppLogs("admin-service", "172.16.90.200", "INFO");
|
|
|
+ return WebResult.success(list);
|
|
|
+ }
|
|
|
}
|