Skip to content

Commit

Permalink
feat:默认使用 Spring 组建提取方法注解
Browse files Browse the repository at this point in the history
  • Loading branch information
yhyzgn committed Feb 25, 2025
1 parent 6ccbef7 commit e1fc412
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.yhy.http.pigeon.spring.converter.SpringConverter;
import com.yhy.http.pigeon.spring.delegate.SpringHeaderDelegate;
import com.yhy.http.pigeon.spring.delegate.SpringInterceptorDelegate;
import com.yhy.http.pigeon.spring.delegate.SpringMethodAnnotationDelegate;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import okhttp3.Interceptor;
Expand Down Expand Up @@ -105,6 +106,7 @@ <T> T getTarget() {

SpringHeaderDelegate headerDelegate = context.getBean(SpringHeaderDelegate.class);
SpringInterceptorDelegate interceptorDelegate = context.getBean(SpringInterceptorDelegate.class);
SpringMethodAnnotationDelegate methodAnnotationDelegate = context.getBean(SpringMethodAnnotationDelegate.class);

if (!CollectionUtils.isEmpty(globalHeaderList)) {
globalHeaderList.forEach(item -> {
Expand Down Expand Up @@ -160,6 +162,8 @@ <T> T getTarget() {
builder.delegate(interceptorDelegate);
}

builder.delegate(methodAnnotationDelegate);

return (T) builder.methodReuseEnabled(false).build().create(pigeonInterface);
}

Expand Down

0 comments on commit e1fc412

Please sign in to comment.