Skip to content

Commit ff89f87

Browse files
committed
Add skip customer inject annotation.
1 parent 14b2155 commit ff89f87

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

EasyRest/src/main/java/tech/dbgsoftware/easyrest/actors/request/ControllerInvokeActor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import tech.dbgsoftware.easyrest.actors.Signal;
88
import tech.dbgsoftware.easyrest.actors.remote.model.RemoteInvokeObject;
99
import tech.dbgsoftware.easyrest.actors.response.ResponseProcessActor;
10+
import tech.dbgsoftware.easyrest.annotations.method.SkipCustomerInject;
1011
import tech.dbgsoftware.easyrest.aop.customer.CustomInjection;
1112
import tech.dbgsoftware.easyrest.ioc.utils.BeanOperationUtils;
1213
import tech.dbgsoftware.easyrest.model.HttpEntity;
@@ -74,7 +75,7 @@ private Object invokeMethod(Method method, Class<?> controller, Object[] args, S
7475
}
7576

7677
private void invokePerCheck(Object classz, HttpEntity httpEntity) throws Exception {
77-
if (httpEntity != null && classz instanceof CustomInjection) {
78+
if (!httpEntity.getMethod().isAnnotationPresent(SkipCustomerInject.class) && httpEntity != null && classz instanceof CustomInjection) {
7879
CustomInjection.class.getMethods()[0].invoke(classz, httpEntity);
7980
}
8081
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package tech.dbgsoftware.easyrest.annotations.method;
2+
3+
import java.lang.annotation.*;
4+
5+
/**
6+
* Created by honliu on 2019/6/26.
7+
*/
8+
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
9+
@Retention(RetentionPolicy.RUNTIME)
10+
@Documented
11+
public @interface SkipCustomerInject {
12+
}

0 commit comments

Comments
 (0)