package com.product.admin.controller;
|
|
import com.product.admin.config.CmnCode;
|
import com.product.admin.service.MonitorService;
|
import com.product.core.controller.support.AbstractBaseController;
|
import com.product.core.entity.FieldSetEntity;
|
import com.product.core.exception.BaseException;
|
import com.product.module.sys.version.ApiVersion;
|
import com.product.util.BaseUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
/**
|
* Copyright © 6c
|
*
|
* @Date 2022年08月24日 15:02
|
* @Author 6c
|
* @Description
|
*/
|
@RestController
|
@RequestMapping("/api/monitor")
|
public class SystemMonitorController extends AbstractBaseController {
|
@Autowired
|
private MonitorService monitorService;
|
|
|
@PostMapping("/system/info/{version}")
|
@ApiVersion(1)
|
public String getSystemInfo(HttpServletRequest request) {
|
FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
|
return BaseUtil.success(monitorService.getSystemInfo(fse.getBoolean("newRecord")));
|
}
|
|
@PostMapping("/system/online-number/{version}")
|
@ApiVersion(1)
|
public String getSystemOnlineNumber() {
|
return BaseUtil.success(monitorService.getUnitPortalStaffInfo());
|
}
|
|
|
/**
|
* 首页监控信息-超级管理员
|
*
|
* @param request
|
* @return
|
*/
|
@PostMapping("/get-admin-index-page-info/{version}")
|
@ApiVersion(1)
|
public String getAdminIndexPageMonitorInfo(HttpServletRequest request) {
|
try {
|
return BaseUtil.success(monitorService.getAdminIndexPageMonitorInfo());
|
} catch (BaseException e) {
|
return error(e);
|
} catch (Exception e) {
|
return error(CmnCode.GET_ADMIN_INDEX_PAGE_MONITOR_INFO_FAIL);
|
}
|
}
|
|
/**
|
* 首页监控信息-单位管理员
|
*
|
* @param request
|
* @return
|
*/
|
@PostMapping("/get-unit-admin-index-page-info/{version}")
|
@ApiVersion(1)
|
public String getUnitAdminIndexPageMonitorInfo(HttpServletRequest request) {
|
try {
|
return BaseUtil.success(monitorService.getUnitAdminIndexPageMonitorInfo());
|
} catch (BaseException e) {
|
return error(e);
|
} catch (Exception e) {
|
return error(CmnCode.GET_UNIT_ADMIN_INDEX_PAGE_MONITOR_INFO_FAIL);
|
}
|
}
|
}
|