package com.yunzhupaas.base.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import com.yunzhupaas.base.ActionResult;
import com.yunzhupaas.base.model.monitor.MonitorListVO;
import com.yunzhupaas.util.JsonUtil;
import com.yunzhupaas.base.util.MonitorUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统监控
 *
 * @author 云筑产品开发平台组
 * @version V3.1.0
 * @copyright 深圳市乐程软件有限公司
 * @date 2023/09/27
 */
@Tag(name = "系统监控", description = "Monitor")
@RestController
@RequestMapping("/api/system/Monitor")
public class MonitorController {

    /**
     * 系统监控
     *
     * @return ignore
     */
    @Operation(summary = "系统监控")
    @SaCheckPermission("system.monitor")
    @GetMapping
    public ActionResult<MonitorListVO> list() {
        MonitorUtil monitorUtil = new MonitorUtil();
        MonitorListVO vo = JsonUtil.getJsonToBean(monitorUtil, MonitorListVO.class);
        vo.setTime(System.currentTimeMillis());
        return ActionResult.success(vo);
    }
}

