背景: 接口调试,特此纪要.
问题: 接口参数为List<Entity>时如何传递?
解决办法:
{
"xxxList": [
{
"id": "2",
"xx": "666"
},
{
"id": "1",
"xx": "666888"
}
]
}
说明: 也可以在"http://www.bejson.com/jsoneditoronline/"该链接中进行JSON对象编辑.
下面附上相应的截图以供参考:
import java.util.List;
import com.Entity;
public class Ladding {
private List<Entity> entityList;
public List<Entity> getEntityList() {
return entityList;
}
public void setEntityList(List<Entity> entityList) {
this.entityList = entityList;
}
}