优化spel表达式解析工具类

This commit is contained in:
dark
2021-03-18 23:12:49 +08:00
parent 7f84e44e94
commit 27faa6153a
3 changed files with 43 additions and 7 deletions

View File

@@ -13,7 +13,13 @@ import java.lang.annotation.*;
*/
public @interface BizTracing {
/**
* 交易流水tag名
*/
String BIZ_ID_TAG = "bizId";
/**
* 交易类型tag名
*/
String BIZ_TYPE_TAG = "bizType";
String bizId();

View File

@@ -21,8 +21,8 @@ public class BizTracingAop {
@Around(value = "@annotation(bizTracing)")
public void tagBizInfo(ProceedingJoinPoint joinPoint, BizTracing bizTracing) {
String bizId = SpElUtil.analysisSpEl(bizTracing.bizId(), joinPoint);
String bizType = SpElUtil.analysisSpEl(bizTracing.bizType(), joinPoint);
String bizId = (String) SpElUtil.analysisSpEl(bizTracing.bizId(), joinPoint);
String bizType = (String) SpElUtil.analysisSpEl(bizTracing.bizType(), joinPoint);
if (StrUtil.isBlankIfStr(bizId)) {
log.error("empty biz: bizId[{}], bizType[{}].", bizId, bizType);
return;