xhanthow commented on issue #2577:
URL:
https://github.com/apache/servicecomb-java-chassis/issues/2577#issuecomment-919724851
> 你的意思不是很理解,貌似 java-chassis 是支持的。 从使用者的角度, 能否举一个简单的代码例子?
```java
private final RestTemplate restTemplate = RestTemplateBuilder.create();
@RpcReference(microserviceName = "testDemo", schemaId = "xx")
private TestApi testApi;
@Test
public void test1() {
Response response = restTemplate.getForObject("url", Response.class);
System.out.println(response);
}
@Test
public void test2() {
Response response = testDemo.test("ids");
System.out.println(response);
}
```
testDemo服务的test方法定义的返回值为test.Response,但是调用方如test1(),test2()中返回的Response路径为local.Response,那么这个时候test1()会报castexception,但是test2()是ok的
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]