王学岗gson解析出错

解析json一直报错,这个异常Expected ?but was ?,查看了下返回的数据格式,发现服务器返回的数据格式不正确:
返回的数据:
{"code":200,"message":"OK","data":{"order_type_nid":"order_extra_service_free","extra":[],"report":[],"loan":[],"extra_free_product":[{"logo":"https://app.haoshijinfu.com/img/cost/icon_recommend.png","name":"借款 1000元/7天","remark":"放款快,周期长,利率低","price":"0.00","old_price":"88.00"}]},"error_code":0,"error_message":"","time":"2019-01-25 14:47:46"}
修改为:
{"code":200,"message":"OK","data":{"order_type_nid":"order_extra_service_free","extra":null,"report":null,"loan":null,"extra_free_product":[{"logo":"https://app.haoshijinfu.com/img/cost/icon_recommend.png","name":"借款 1000元/7天","remark":"放款快,周期长,利率低","price":"0.00","old_price":"88.00"}]},"error_code":0,"error_message":"","time":"2019-01-25 16:01:05"}
记着让后台把"extra":[],"report":[],"loan":[]修改为"extra":null,"report":null,"loan":null;不然你都不知道自己是怎么死的,就这个问题,马丹折磨了我一上午
这是实体类
``
public class OrderInfoDetailEntity {
private String order_type_nid;//订单类型
private LoanEntity loan;//免费订单
private ExtraEntity extra;//增值订单
private ReportEntity report;//报告订单
private List<Extra_free_product> extra_free_product;

public String getOrder_type_nid() {
    return order_type_nid;
}

public void setOrder_type_nid(String order_type_nid) {
    this.order_type_nid = order_type_nid;
}

public LoanEntity getLoan() {
    return loan;
}

public void setLoan(LoanEntity loan) {
    this.loan = loan;
}

public ExtraEntity getExtra() {
    return extra;
}

public void setExtra(ExtraEntity extra) {
    this.extra = extra;
}

public ReportEntity getReport() {
    return report;
}

public void setReport(ReportEntity report) {
    this.report = report;
}

public List<Extra_free_product> getExtra_free_product() {
    return extra_free_product;
}

public void setExtra_free_product(List<Extra_free_product> extra_free_product) {
    this.extra_free_product = extra_free_product;
}

public static class Extra_free_product{
    private String logo;
    private String name;
    private String remark;
    private String price;
    private String old_price;

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getOld_price() {
        return old_price;
    }

    public void setOld_price(String old_price) {
        this.old_price = old_price;
    }
}

public static class LoanEntity{
    private String amount;
    private String order_no;
    private String status;
    private String create_at;
    private String push_status;
    private String expired_time;
    private String term;

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public String getExpired_time() {
        return expired_time;
    }

    public void setExpired_time(String expired_time) {
        this.expired_time = expired_time;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreate_at() {
        return create_at;
    }

    public void setCreate_at(String create_at) {
        this.create_at = create_at;
    }

    public String getPush_status() {
        return push_status;
    }

    public void setPush_status(String push_status) {
        this.push_status = push_status;
    }

    @Override
    public String toString() {
        return "LoanEntity{" +
                "amount='" + amount + '\'' +
                ", order_no='" + order_no + '\'' +
                ", status='" + status + '\'' +
                ", create_at='" + create_at + '\'' +
                ", push_status='" + push_status + '\'' +
                ", expired_time='" + expired_time + '\'' +
                ", term='" + term + '\'' +
                '}';
    }
}

public static class ExtraEntity{
    private String amount;
    private String status;
    private String term;
    private String stop_time;
    private List<BorrowEntity> borrow;
    private List<ConfirmEntity> confirm;

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public String getStop_time() {
        return stop_time;
    }

    public void setStop_time(String stop_time) {
        this.stop_time = stop_time;
    }

    public List<BorrowEntity> getBorrow() {
        return borrow;
    }

    public void setBorrow(List<BorrowEntity> borrow) {
        this.borrow = borrow;
    }

    public List<ConfirmEntity> getConfirm() {
        return confirm;
    }

    public void setConfirm(List<ConfirmEntity> confirm) {
        this.confirm = confirm;
    }

    @Override
    public String toString() {
        return "ExtraEntity{" +
                "amount='" + amount + '\'' +
                ", status='" + status + '\'' +
                ", term='" + term + '\'' +
                ", stop_time='" + stop_time + '\'' +
                ", borrow=" + borrow +
                ", confirm=" + confirm +
                '}';
    }

    public static class BorrowEntity{
        private String ext_prod_name;
        private String logo;
        private String url;
        private String money_limit;

        public String getExt_prod_name() {
            return ext_prod_name;
        }

        public void setExt_prod_name(String ext_prod_name) {
            this.ext_prod_name = ext_prod_name;
        }

        public String getLogo() {
            return logo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getMoney_limit() {
            return money_limit;
        }

        public void setMoney_limit(String money_limit) {
            this.money_limit = money_limit;
        }

        @Override
        public String toString() {
            return "BorrowEntity{" +
                    "platform_name='" + ext_prod_name + '\'' +
                    ", logo='" + logo + '\'' +
                    ", url='" + url + '\'' +
                    ", money_limit='" + money_limit + '\'' +
                    '}';
        }
    }
    public static class ConfirmEntity{
        private String time;
        private String remark;
        private String status;

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        @Override
        public String toString() {
            return "ConfirmEntity{" +
                    "time='" + time + '\'' +
                    ", remark='" + remark + '\'' +
                    ", status='" + status + '\'' +
                    '}';
        }
    }
}
public static class ReportEntity{
    private String amount;
    private String order_no;
    private String status;
    private String create_at;
    private String url;

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreate_at() {
        return create_at;
    }

    public void setCreate_at(String create_at) {
        this.create_at = create_at;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}

}

``

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,290评论 6 491
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,107评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,872评论 0 347
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,415评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,453评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,784评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,927评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,691评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,137评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,472评论 2 326
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,622评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,289评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,887评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,741评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,977评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,316评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,490评论 2 348

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,308评论 0 10
  • Overview The ccxt library is a collection of available cr...
    郭蝈儿蝈儿阅读 3,667评论 0 1
  • 那天听到一个节目,说一个卖早点的阿姨成了网红,她既没有什么执照,也没有固定摊位,就一流动摊贩,生意却很好。...
    闲吧阅读 165评论 0 0
  • 一:简述 Linux-Ceentos系统开机启动流程简述如下,后续小节会对重要节点做详细描述 1:加电自检 --...
    mapipi阅读 371评论 0 1
  • 1 今年我22岁,大学毕业有1年了,目前在江南某电子厂品质部作文职工作。接触最多,关系也最近的自然是那群叽叽喳喳的...
    青青河边草Grace阅读 588评论 5 6