| | |
| | | import com.alibaba.fastjson.JSONArray;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import org.xutils.http.annotation.HttpResponse;
|
| | | import org.xutils.sample.http.JsonResponseParser;
|
| | |
|
| | | @HttpResponse(parser = JsonResponseParser.class)
|
| | | public class ResultBean {
|
| | | public static final String OK = "0";
|
| | | public static final String APPLICATION_EXCEPTION = "-1";
|
| | | private String code;
|
| | | private String message;
|
| | | private Object data;
|
| | | private int totalPages;
|
| | | private int pageNum;
|
| | |
|
| | |
|
| | | public String getCode() {
|
| | | return code;
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public <T> List<T> getListBeanOfType(Class<T> requiredType) {
|
| | | public <T> List<T> getList(Class<T> requiredType) {
|
| | | if (data != null) {
|
| | | if (data instanceof JSONArray) {
|
| | | JSONArray jsonArray = (JSONArray) data;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public List getDataObject(Class requiredType) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | public int getTotalPages() {
|
| | | return totalPages;
|
| | | }
|
| | | public void setTotalPages(int totalPages) {
|
| | | this.totalPages = totalPages;
|
| | | }
|
| | |
|
| | | public void setPageNum(int pageNum) {
|
| | | this.pageNum = pageNum;
|
| | | }
|
| | |
|
| | | public int getPageNum() {
|
| | | return pageNum;
|
| | | }
|
| | |
|
| | | public boolean hasMorePages() {
|
| | | return getPageNum() < getTotalPages();
|
| | | }
|
| | | }
|