package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.ProcessSurvey;
|
import com.whyc.pojo.ServerState;
|
import com.whyc.service.ProcessSurveyService;
|
import com.whyc.service.ServerStateService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
@Api(tags = "服务器管理")
|
@RestController
|
@RequestMapping("ServerManage")
|
public class ServerManageController {
|
@Resource
|
private ServerStateService serverStateService;
|
@Resource
|
private ProcessSurveyService processSurveyService;
|
|
@ApiOperation("查询服务器信息和线程信息")
|
@GetMapping("getServerManageInfo")
|
public Response getServerManageInfo() {
|
Map dataMap = new HashMap();
|
//查询服务器信息
|
ServerState serverState = serverStateService.searchAll();
|
dataMap.put("serverState", serverState);
|
//查询线程状态
|
List<ProcessSurvey> processSurveyList = (List<ProcessSurvey>) processSurveyService.getAll().getData();
|
dataMap.put("processSurvey", processSurveyList);
|
|
return new Response().set(1, dataMap);
|
}
|
}
|