{
"data": [
{
"resource": "teams",
"id": 1,
"name": "Pakistan",
"code": "PAK",
"image_path": "https://cdn.sportmonks.com/images/cricket/teams/1/1.png",
"country_id": 190324,
"national_team": true,
"updated_at": "2018-11-29T11:47:20.000000Z"
}
]
}
你可以这样写
public class Response{
private List<Data> data;
// getter and setter
}
class Data{
private String resource;
private int id;
private String name;
private String code;
@SerializedName("image_path")
private String imagePath;
@SerializedName("country_id")
private long countryId;
@SerializedName("national_team")
private boolean nationalTeam;
@SerializedName("updated_at")
private String updatedAt;
// getters and setters
}