提交 b3662f21 编写于 作者: zhouweidong's avatar zhouweidong

修复服务接口嵌套版本检查bug

上级 5a16b61f
...@@ -50,8 +50,9 @@ public class VersionCheckAspect ...@@ -50,8 +50,9 @@ public class VersionCheckAspect
@Before("execution(* ${pub.getPKGCodeName()}.*.rest.*.updateBy*(..)) && @annotation(versionCheck)") @Before("execution(* ${pub.getPKGCodeName()}.*.rest.*.updateBy*(..)) && @annotation(versionCheck)")
public void BeforeUpdateBy(JoinPoint point, VersionCheck versionCheck){ public void BeforeUpdateBy(JoinPoint point, VersionCheck versionCheck){
Object[] args = point.getArgs(); Object[] args = point.getArgs();
Object id=args[1]; if(args.length>=2){
Object dto=args[2]; Object id=args[args.length-2];
Object dto=args[args.length-1];
if(ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(dto)) if(ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(dto))
return; return;
String versionField=versionCheck.versionfield(); String versionField=versionCheck.versionfield();
...@@ -59,6 +60,7 @@ public class VersionCheckAspect ...@@ -59,6 +60,7 @@ public class VersionCheckAspect
return; return;
versionCheck(versionCheck,point.getTarget(),dto,id); versionCheck(versionCheck,point.getTarget(),dto,id);
} }
}
private void versionCheck(VersionCheck versionCheck,Object resource,Object dto,Object id ){ private void versionCheck(VersionCheck versionCheck,Object resource,Object dto,Object id ){
EvaluationContext context = new StandardEvaluationContext(); EvaluationContext context = new StandardEvaluationContext();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册