com.nxyfan.framework.sys.controller.SysLogController Maven / Gradle / Ivy
package com.nxyfan.framework.sys.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.nxyfan.framework.common.annotation.CommonLog;
import com.nxyfan.framework.common.pojo.CommonResult;
import com.nxyfan.framework.core.entity.SysLog;
import com.nxyfan.framework.core.param.SysLogDeleteParam;
import com.nxyfan.framework.core.param.SysLogPageParam;
import com.nxyfan.framework.core.result.SysLogOpBarChartDataResult;
import com.nxyfan.framework.core.result.SysLogOpPieChartDataResult;
import com.nxyfan.framework.core.result.SysLogVisLineChartDataResult;
import com.nxyfan.framework.core.result.SysLogVisPieChartDataResult;
import com.nxyfan.framework.core.service.SysLogService;
import javax.annotation.Resource;
import java.util.List;
/**
* 日志控制器
*
* @author xuyuxiang
* @date 2022/9/2 15:15
*/
@Api(tags = "日志控制器")
@ApiSupport(author = "NXYFAN_TEAM", order = 5)
@RestController
@Validated
public class SysLogController {
@Resource
private SysLogService devLogService;
/**
* 获取日志分页
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 1)
@ApiOperation("获取日志分页")
@PostMapping("/sys/log/page")
public CommonResult> page(@RequestBody SysLogPageParam devLogPageParam) {
return CommonResult.data(devLogService.page(devLogPageParam));
}
/**
* 清空日志
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 2)
@ApiOperation("清空日志")
@CommonLog("清空日志")
@PostMapping("/sys/log/delete")
public CommonResult delete(@RequestBody SysLogDeleteParam devLogDeleteParam) {
devLogService.delete(devLogDeleteParam);
return CommonResult.ok();
}
/**
* 获取访问日志折线图数据
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 3)
@ApiOperation("获取访问日志折线图数据")
@GetMapping("/sys/log/vis/lineChartData")
public CommonResult> visLogLineChartData() {
return CommonResult.data(devLogService.visLogLineChartData());
}
/**
* 获取访问日志饼状图数据
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 4)
@ApiOperation("获取访问日志饼状图数据")
@GetMapping("/sys/log/vis/pieChartData")
public CommonResult> visLogPieChartData() {
return CommonResult.data(devLogService.visLogPieChartData());
}
/**
* 获取操作日志柱状图数据
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 5)
@ApiOperation("获取操作日志柱状图数据")
@GetMapping("/sys/log/op/barChartData")
public CommonResult> opLogBarChartData() {
return CommonResult.data(devLogService.opLogBarChartData());
}
/**
* 获取操作日志饼状图数据
*
* @author xuyuxiang
* @date 2022/4/24 20:00
*/
@ApiOperationSupport(order = 5)
@ApiOperation("获取操作日志饼状图数据")
@GetMapping("/sys/log/op/pieChartData")
public CommonResult> opLogPieChartData() {
return CommonResult.data(devLogService.opLogPieChartData());
}
}