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> 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 exceptionLogIds) { exceptionLogService.removeByIds(exceptionLogIds); return ResultVO.ok(); } }