服务名模式
@Resource
private LoadBalancerClient loadBalancerClient;
@Resource
private RestTemplate restTemplate;
ServiceInstance instance = loadBalancerClient.choose(Constant.INSTANCE_GATEWAY);
URI uri = instance.getUri();
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.set("Authorization", token);
Map paramMap = new HashMap<>();
HttpEntity httpEntity = new HttpEntity(httpHeaders);
ResponseEntity<返回类> exchange = restTemplate.exchange(
uri + "/上下文", HttpMethod.GET
, httpEntity, 返回.class, paramMap);
if (exchange返回类处理) {
//可选
// ObjectMapper mapper = new ObjectMapper();
// Map data = mapper.convertValue(exchange.getBody().getData(), Map.class);



