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/OperationLogController.java

44 lines
1.7 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.OperationLogDTO;
import com.aurora.model.vo.ResultVO;
import com.aurora.service.OperationLogService;
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 OperationLogController {
@Autowired
private OperationLogService operationLogService;//调用Service层的操作日志业务方法
@ApiOperation(value = "查看操作日志")//比如查看用户的新增、修改、删除等操作记录
@GetMapping("/admin/operation/logs")
public ResultVO<PageResultDTO<OperationLogDTO>> listOperationLogs(ConditionVO conditionVO) {
//ConditionVO conditionVO封装操作日志的查询条件比如操作人、操作类型、时间范围等
return ResultVO.ok(operationLogService.listOperationLogs(conditionVO));
}
@OptLog(optType = DELETE)
@ApiOperation(value = "删除操作日志")
@DeleteMapping("/admin/operation/logs")
public ResultVO<?> deleteOperationLogs(@RequestBody List<Integer> operationLogIds) {
operationLogService.removeByIds(operationLogIds);
return ResultVO.ok();
}
}