Commit 371f8b3b by Spencer Gibb

feign polishing

parent b0b4916d
...@@ -27,6 +27,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware; ...@@ -27,6 +27,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistry;
...@@ -105,6 +106,7 @@ public class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ...@@ -105,6 +106,7 @@ public class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
definition.addPropertyValue("url", getUrl(attributes)); definition.addPropertyValue("url", getUrl(attributes));
definition.addPropertyValue("name", getServiceId(attributes)); definition.addPropertyValue("name", getServiceId(attributes));
definition.addPropertyValue("type", className); definition.addPropertyValue("type", className);
definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
String beanName = StringUtils.uncapitalize(className.substring(className String beanName = StringUtils.uncapitalize(className.substring(className
.lastIndexOf(".") + 1)); .lastIndexOf(".") + 1));
......
...@@ -42,10 +42,10 @@ public class SpringMvcContract extends Contract.BaseContract { ...@@ -42,10 +42,10 @@ public class SpringMvcContract extends Contract.BaseContract {
private static final String CONTENT_TYPE = "Content-Type"; private static final String CONTENT_TYPE = "Content-Type";
@Override @Override
public MethodMetadata parseAndValidatateMetadata(Method method) { protected MethodMetadata parseAndValidateMetadata(Class<?> targetType, Method method) {
MethodMetadata md = super.parseAndValidatateMetadata(method); MethodMetadata md = super.parseAndValidateMetadata(targetType, method);
RequestMapping classAnnotation = method.getDeclaringClass().getAnnotation(RequestMapping.class); RequestMapping classAnnotation = targetType.getAnnotation(RequestMapping.class);
if (classAnnotation != null) { if (classAnnotation != null) {
// Prepend path from class annotation if specified // Prepend path from class annotation if specified
if (classAnnotation.value().length > 0) { if (classAnnotation.value().length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment