Przeglądaj źródła

update AppStatPageController

reghao 6 miesięcy temu
rodzic
commit
c12ffa2999

+ 4 - 0
mgr/src/main/java/cn/reghao/devops/mgr/app/controller/page/AppStatPageController.java

@@ -72,6 +72,7 @@ public class AppStatPageController {
 
     @ApiOperation(value = "重启应用", notes = "N")
     @PostMapping(value = "/restart/{appId}/{machineId}", produces = MediaType.APPLICATION_JSON_VALUE)
+    @ResponseBody
     public String restart(@PathVariable("appId") String appId, @PathVariable("machineId") String machineId) throws Exception {
         appRunService.changeStatus(appId, machineId, AppStatOps.restart);
         return WebResult.result(Result.result(ResultStatus.SUCCESS, appId + " 正在重启,请 10s 后刷新页面查看最新状态"));
@@ -79,6 +80,7 @@ public class AppStatPageController {
 
     @ApiOperation(value = "停止应用", notes = "N")
     @PostMapping(value = "/stop/{appId}/{machineId}", produces = MediaType.APPLICATION_JSON_VALUE)
+    @ResponseBody
     public String stop(@PathVariable("appId") String appId, @PathVariable("machineId") String machineId) throws Exception {
         appRunService.changeStatus(appId, machineId, AppStatOps.stop);
         return WebResult.result(Result.result(ResultStatus.SUCCESS, appId + " 正在停止,请稍后刷新页面"));
@@ -86,6 +88,7 @@ public class AppStatPageController {
 
     @ApiOperation(value = "启动应用", notes = "N")
     @PostMapping(value = "/start/{appId}/{machineId}", produces = MediaType.APPLICATION_JSON_VALUE)
+    @ResponseBody
     public String start(@PathVariable("appId") String appId, @PathVariable("machineId") String machineId) throws Exception {
         appRunService.changeStatus(appId, machineId, AppStatOps.start);
         return WebResult.result(Result.result(ResultStatus.SUCCESS, appId + " 正在启动,请 10s 后刷新页面查看最新状态"));
@@ -93,6 +96,7 @@ public class AppStatPageController {
 
     @ApiOperation(value = "应用当前状态", notes = "N")
     @GetMapping(value = "/{appId}/{machineId}", produces = MediaType.APPLICATION_JSON_VALUE)
+    @ResponseBody
     public String status(@PathVariable("appId") String appId, @PathVariable("machineId") String machineId) {
         appRunService.getStatus(appId, machineId);
         String msg = String.format("正在获取 %s 的状态,请 10s 后刷新页面查看", appId);