| New file |
| | |
| | | package org.sxkj.core.log.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.sxkj.core.log.dto.OperationLogDTO; |
| | | import org.sxkj.core.log.model.OperationLog; |
| | | import org.sxkj.core.log.param.OperationLogPageParam; |
| | | import org.sxkj.core.log.service.IOperationLogService; |
| | | import org.sxkj.core.log.vo.OperationLogVO; |
| | | import org.sxkj.core.log.wrapper.OperationLogWrapper; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @Description 操作日志控制器 |
| | | * @Author AIX |
| | | * @Date 2026/1/15 17:33 |
| | | * @Version 1.0 |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/log/operationLog") |
| | | @Api(value = "操作日志", tags = "操作日志") |
| | | public class OperationLogController extends BladeController { |
| | | |
| | | private final IOperationLogService operationLogService; |
| | | |
| | | /** |
| | | * 查询单条 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public R<OperationLog> detail(OperationLog log) { |
| | | return R.data(operationLogService.getOne(Condition.getQueryWrapper(log))); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * @param operationLogPageParam |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public R<IPage<OperationLogVO>> page(OperationLogPageParam operationLogPageParam, Query query) { |
| | | IPage<OperationLogVO> pages = operationLogService.selectOperationLogPage(Condition.getPage(query), |
| | | operationLogPageParam); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增操作日志 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "新增操作日志", notes = "新增操作日志") |
| | | public R<Boolean> save(@Valid @RequestBody OperationLogDTO operationLogDTO) { |
| | | OperationLog operationLog = OperationLogWrapper.build().entityDTO(operationLogDTO); |
| | | return R.status(operationLogService.save(operationLog)); |
| | | } |
| | | |
| | | } |