¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.sys; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ResEntity; |
| | | import com.lf.server.service.all.ScheduleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ§å¶å°æ§å¶å¨ |
| | | * @author WWW |
| | | * @date 2022-09-21 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æ§å¶å°") |
| | | @RestController |
| | | @RequestMapping("/ctrl") |
| | | public class CtrlController extends BaseController { |
| | | @Autowired |
| | | private ScheduleService scheduleService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æå¡å¨ç¶æ") |
| | | @GetMapping(value = "/selectServerStatus") |
| | | public ResponseMsg<JSONObject> selectServerStatus() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectServerStatus(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢Cpuä¿¡æ¯") |
| | | @GetMapping(value = "/selectCpuInfo") |
| | | public ResponseMsg<JSONObject> selectCpuInfo() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectCpuInfo(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
åä¿¡æ¯") |
| | | @GetMapping(value = "/selectMemInfo") |
| | | public ResponseMsg<JSONObject> selectMemInfo() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectMemInfo(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¨çº¿ç¨æ·") |
| | | @GetMapping(value = "/selectOnlineUsers") |
| | | public ResponseMsg<List<JSONObject>> selectOnlineUsers() { |
| | | try { |
| | | List<JSONObject> list = scheduleService.selectOnlineUsers(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æå¡èµæºç¶æ") |
| | | @GetMapping(value = "/selectResStatus") |
| | | public ResponseMsg<List<ResEntity>> selectResStatus() { |
| | | try { |
| | | List<ResEntity> list = scheduleService.selectResStatus(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |