改装手柄助焊剂返回类型

时间:2018-10-26 07:34:04

标签: java spring-boot retrofit retrofit2 flux

如何在改造中处理Flux返回类型?

EndPointApi

public interface DataEndPointApi {
   @GET( "ap1/v3/data")
   Flux<Data> getAllData(@Query( "dataType") String dataType);
}

RetroRestAdapter

@Autowired
private ObjectMapper objectMapper;

RestAdapter retrofit = new RestAdapter.Builder()
         .setEndpoint( "http://localhost:8080" )
         .setConverter( new JacksonConverter( this.objectMapper ) )         
         .build();

呼叫者

DatasourceEndPointApi datasourceEndPointApi;
Flux<Data> dataFlux = this.dataEndPointApi.getAllData( "GREETING" );

我遇到了错误

错误

retrofit.RetrofitError: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `reactor.core.publisher.Flux` (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
 at [Source: (retrofit.ExceptionCatchingTypedInput$ExceptionCatchingInputStream); line: 1, column: 1]
    at retrofit.RetrofitError.conversionError(RetrofitError.java:33)
    at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
    at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
    at com.sun.proxy.$Proxy153.getAllDatasource(Unknown Source)
    at 

那么,如何在翻新中处理Flux返回类型?

0 个答案:

没有答案