Search in sources :

Example 11 with MetaRequest

use of com.dtflys.forest.reflection.MetaRequest in project forest by dromara.

the class OptionsRequestLifeCycle method onMethodInitialized.

@Override
public void onMethodInitialized(ForestMethod method, Annotation annotation) {
    MetaRequest metaRequest = createMetaRequest(annotation);
    metaRequest.setType(ForestRequestType.OPTIONS.getName());
    method.setMetaRequest(metaRequest);
}
Also used : MetaRequest(com.dtflys.forest.reflection.MetaRequest)

Example 12 with MetaRequest

use of com.dtflys.forest.reflection.MetaRequest in project forest by dromara.

the class PatchRequestLifeCycle method onMethodInitialized.

@Override
public void onMethodInitialized(ForestMethod method, Annotation annotation) {
    MetaRequest metaRequest = createMetaRequest(annotation);
    metaRequest.setType(ForestRequestType.PATCH.getName());
    method.setMetaRequest(metaRequest);
}
Also used : MetaRequest(com.dtflys.forest.reflection.MetaRequest)

Example 13 with MetaRequest

use of com.dtflys.forest.reflection.MetaRequest in project forest by dromara.

the class RequestLifeCycle method createMetaRequest.

protected MetaRequest createMetaRequest(Annotation annotation) {
    MetaRequest metaRequest = new MetaRequest(annotation);
    ReflectUtils.copyAnnotationAttributes(annotation, metaRequest);
    return metaRequest;
}
Also used : MetaRequest(com.dtflys.forest.reflection.MetaRequest)

Example 14 with MetaRequest

use of com.dtflys.forest.reflection.MetaRequest in project forest by dromara.

the class RequestLifeCycle method onMethodInitialized.

@Override
public void onMethodInitialized(ForestMethod method, Annotation annotation) {
    MetaRequest metaRequest = createMetaRequest(annotation);
    method.setMetaRequest(metaRequest);
}
Also used : MetaRequest(com.dtflys.forest.reflection.MetaRequest)

Example 15 with MetaRequest

use of com.dtflys.forest.reflection.MetaRequest in project forest by dromara.

the class TestInterfaceProxyHandler method testBaseURL.

@Test
public void testBaseURL() {
    ProxyFactory<LocalhostBaseURLClient> getClientProxyFactory = new ProxyFactory<>(configuration, LocalhostBaseURLClient.class);
    InterfaceProxyHandler<LocalhostBaseURLClient> interfaceProxyHandler = new InterfaceProxyHandler(configuration, getClientProxyFactory, LocalhostBaseURLClient.class);
    MetaRequest metaRequest = interfaceProxyHandler.getBaseMetaRequest();
    assertEquals("http://localhost", metaRequest.getUrl());
}
Also used : InterfaceProxyHandler(com.dtflys.forest.proxy.InterfaceProxyHandler) ProxyFactory(com.dtflys.forest.proxy.ProxyFactory) MetaRequest(com.dtflys.forest.reflection.MetaRequest) Test(org.junit.Test)

Aggregations

MetaRequest (com.dtflys.forest.reflection.MetaRequest)24 ForestRuntimeException (com.dtflys.forest.exceptions.ForestRuntimeException)6 MappingParameter (com.dtflys.forest.mapping.MappingParameter)4 Annotation (java.lang.annotation.Annotation)4 Parameter (java.lang.reflect.Parameter)4 InterfaceProxyHandler (com.dtflys.forest.proxy.InterfaceProxyHandler)3 ProxyFactory (com.dtflys.forest.proxy.ProxyFactory)3 Test (org.junit.Test)3 ForestConfiguration (com.dtflys.forest.config.ForestConfiguration)2 LogConfiguration (com.dtflys.forest.logging.LogConfiguration)2 ForestEncoder (com.dtflys.forest.converter.ForestEncoder)1 Filter (com.dtflys.forest.filter.Filter)1 ForestLogHandler (com.dtflys.forest.logging.ForestLogHandler)1 MappingTemplate (com.dtflys.forest.mapping.MappingTemplate)1 ForestMultipartFactory (com.dtflys.forest.multipart.ForestMultipartFactory)1