I want to get information from baidu music web api. I use below tow link: http://openapi.baidu.com/rest/2.0/music/billboard/billlist?page_size=50×tamp=2016-09-22+18%3A47%3A54&sign=b2e34bd4b6c19a065d5a7e49e591a41b&session_key=9mzdDcHtDENrxP3Spvk7ZFbNHNijT8l8fN%2BfI%2Fe3U5rh3U5g%2FDVvjZyqB48aJaYO5qaqw4JbugF79hgAQ%2FGBIixUSuaP&type=21&page_no=1
only type is different. one is 23 and another is 21. For return jason: one is billboard21, another is billboard23. If I want to use retrofit2 to accessa api and parse return jason, should I define two different java class to handler this two different return? In face, there is about 17 type, how can I handle this case if don't want to create 17 java classes?
my access api is:
@GET("/rest/2.0/music/billboard/billlist")
Call<BaiduBillListContainer> getBillList(@Query("timestamp") String timestamp,
@Query("type") String type,
@Query("sign") String sign,
@Query("session_key") String sessionkey,
@Query("page_size") String pagesize,
@Query("page_no") String pageno);
BaiduBillListContainer.java define:
public class BaiduBillListContainer implements Serializable {
BaiduBillList billboard21;
public BaiduBillList getBillBoardInfo() {
return billboard21;
}
public void setBillBoardInfo(BaiduBillList billBoardInfo) {
this.billboard21 = billBoardInfo;
}
}
it cannot used to get billboard23 return. Any one can help me about this question? thanks very much.