当我返回通用时,终点 api 文件似乎消失了。示例代码已粘贴。
@ApiMethod
public RestResponse<Container> testGeneric() {
Container container = new Container();
container.testLong = (long)4345;
container.testDate = new Date();
container.testString = "sathya";
container.testDouble = 123.98;
container.testInt = 123;
RestResponse<Container> response = new RestResponse<Container>();
response.t = container;
return response;
}
这是端点中的错误吗?根本不允许这样的事情吗?
问候, 沙迪亚
最佳答案
我不认为这是一个错误,但它只是不受支持,就像你不能从你的端点返回一个 String
一样......
为了检查问题是什么,如果您使用的是适用于 Eclipse 的 Google 插件,您可以在 Window -> Show View -> Error Log
下查看错误日志以获取更多信息.
关于google-app-engine - 我可以在 Google Cloud End Point 中返回一个泛型吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15945554/