You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dsl3/controller/ExceptionLogController.java

44 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.aurora.controller;
import com.aurora.annotation.OptLog;
import com.aurora.model.dto.ExceptionLogDTO;
import com.aurora.model.vo.ResultVO;
import com.aurora.service.ExceptionLogService;
import com.aurora.model.vo.ConditionVO;
import com.aurora.model.dto.PageResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.aurora.constant.OptTypeConstant.DELETE;
@Api(tags = "异常日志模块")
@RestController
public class ExceptionLogController {
@Autowired
private ExceptionLogService exceptionLogService;//Spring依赖注入注解自动注入ExceptionLogService的实例
@ApiOperation("获取异常日志")
@GetMapping("/admin/exception/logs")
public ResultVO<PageResultDTO<ExceptionLogDTO>> listExceptionLogs(ConditionVO conditionVO) {
//ConditionVO conditionVO封装后台查询异常日志的条件比如日志的时间范围、异常类型等
return ResultVO.ok(exceptionLogService.listExceptionLogs(conditionVO));
}
@OptLog(optType = DELETE)
@ApiOperation(value = "删除异常日志")
@DeleteMapping("/admin/exception/logs")
public ResultVO<?> deleteExceptionLogs(@RequestBody List<Integer> exceptionLogIds) {
exceptionLogService.removeByIds(exceptionLogIds);
return ResultVO.ok();
}
}