开启 Dubbo Consumer 参数校验

This commit is contained in:
YunaiV
2020-07-17 07:53:24 +08:00
parent 3b5199b60b
commit d619f0fae8
16 changed files with 35 additions and 29 deletions

View File

@@ -51,7 +51,7 @@ public class GlobalExceptionHandler {
private String applicationName;
// TODO 目前存在一个问题,如果未引入 system-rpc-api 依赖GlobalExceptionHandler 会报类不存在。未来封装出 Repository 解决该问题
@Reference(validation = "true", version = "${dubbo.consumer.SystemExceptionLogRpc.version}")
@Reference(version = "${dubbo.consumer.SystemExceptionLogRpc.version}")
private SystemExceptionLogRpc systemExceptionLogRpc;
/**
@@ -199,6 +199,7 @@ public class GlobalExceptionHandler {
.setExceptionTime(new Date());
}
// TODO 优化点:后续可以增加事件
@Async
public void addExceptionLog(SystemExceptionLogCreateDTO exceptionLog) {
try {

View File

@@ -26,7 +26,7 @@ public class AccessLogInterceptor extends HandlerInterceptorAdapter {
private Logger logger = LoggerFactory.getLogger(getClass());
@Reference(validation = "false", version = "${dubbo.consumer.SystemAccessLogRpc.version}")
@Reference(version = "${dubbo.consumer.SystemAccessLogRpc.version}")
private SystemAccessLogRpc systemAccessLogRpc;
@Value("${spring.application.name}")
@@ -77,6 +77,7 @@ public class AccessLogInterceptor extends HandlerInterceptorAdapter {
.setResponseTime((int) (System.currentTimeMillis() - accessLog.getStartTime().getTime())); // 默认响应时间设为 0
}
// TODO 优化点:后续可以增加事件
@Async // 异步入库
public void addAccessLog(SystemAccessLogCreateDTO accessLog) {
try {