You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
671 B
29 lines
671 B
package de.fd.fh.network;
|
|
|
|
import feign.Feign;
|
|
import feign.gson.GsonDecoder;
|
|
import feign.gson.GsonEncoder;
|
|
import feign.okhttp.OkHttpClient;
|
|
import lombok.Getter;
|
|
|
|
@Getter
|
|
public class FeignClients
|
|
{
|
|
private static final String BASE_URL = "http://localhost:4567";
|
|
|
|
private AccessClient accessClient;
|
|
|
|
public FeignClients()
|
|
{
|
|
accessClient = buildClient(AccessClient.class);
|
|
}
|
|
|
|
<T> T buildClient(final Class<T> client)
|
|
{
|
|
return Feign.builder()
|
|
.client(new OkHttpClient())
|
|
.encoder(new GsonEncoder())
|
|
.decoder(new GsonDecoder())
|
|
.target(client, BASE_URL);
|
|
}
|
|
}
|