Cloud Endpoints Collection Parameter

后端 未结 2 731
萌比男神i
萌比男神i 2021-01-05 21:02

Im using Google App Engine Cloud Endpoints and Im trying to receive a collection parameter . Not sure if I can do this. I know I can return a List or any Collection.

2条回答
  •  花落未央
    2021-01-05 21:26

    I have used a similar solution after think during long hours . Try this:

    public class JsonList { 
    private List listItens;
    
    public List getListItens() {
        return listItens;
    }
    
    public void setListItens(List listItens) {
        this.listItens = listItens;
    }}
    

    and in your method:

    @ApiMethod(
            name = "name",
            path = "path",
            httpMethod = ApiMethod.HttpMethod.POST)
    public CollectionResponse getInformation(JsonList listOfItens) {}
    

提交回复
热议问题