📖 code review:操作日志的实现

This commit is contained in:
YunaiV
2023-12-25 21:40:16 +08:00
parent 82a25474f6
commit 5de6a8bd23
20 changed files with 40 additions and 27 deletions

View File

@ -46,9 +46,10 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Springboot-注解-通用操作日志组件 -->
<!-- 此组件解决的问题是: 「谁」在「什么时间」对「什么」做了「什么事」 -->
<dependency>
<!-- Spring Boot 通用操作日志组件,基于注解实现 -->
<!-- 此组件解决的问题是:「谁」在「什么时间」对「什么」做了「什么事」 -->
<groupId>io.github.mouzt</groupId>
<artifactId>bizlog-sdk</artifactId>
</dependency>

View File

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
@AutoConfiguration
public class YudaoOperateLogAutoConfiguration {
// TODO @puhui999这个是不是留着哈因为老版本还是会留着一段时间的
//@Bean
//public OperateLogAspect operateLogAspect() {
// return new OperateLogAspect();

View File

@ -9,6 +9,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
// TODO @puhui999思考了下为了减少 starter 数量,在 security 组件里,增加一个 core/operatelog 包,然后 YudaoOperateLogV2Configuration 搞一个过去;
/**
* mzt-biz-log 配置类
*

View File

@ -44,6 +44,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS;
import static cn.iocoder.yudao.framework.operatelogv2.core.enums.OperateLogV2Constants.*;
// TODO @puhui999这个类是不是可以删除哈简化简化
/**
* 拦截使用 @Operation 注解, 获取操作类型、开始时间、持续时间、方法相关信息、执行结果等信息
* 对 mzt-biz-log 日志信息进行增强

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.operatelogv2.core.enums;
// TODO @puhui999这个类是不是可以删除哈
/**
* 操作日志常量接口
*

View File

@ -23,16 +23,17 @@ public class ILogRecordServiceImpl implements ILogRecordService {
public void record(LogRecord logRecord) {
OperateLogV2Aspect.setContent(logRecord); // 操作日志
OperateLogV2Aspect.addExtra(LogRecordContext.getVariables()); // 扩展信息
// TODO @puhui999这里是不是调用 operateLogApi 进行记录哈
}
@Override
public List<LogRecord> queryLog(String bizNo, String type) {
return Collections.emptyList();
throw new UnsupportedOperationException("不支持该操作,请使用 OperateLogApi 查询!");
}
@Override
public List<LogRecord> queryLogByBizNo(String bizNo, String type, String subType) {
return Collections.emptyList();
throw new UnsupportedOperationException("不支持该操作,请使用 OperateLogApi 查询!");
}
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
// TODO @puhui999这个最好每个模块自己弄哈放这里有点怪可能
@Schema(description = "管理后台 - 操作日志分页 Request VO")
@Data
public class OperateLogV2PageReqVO extends PageParam {