OkHttp + Retrofit 解析请求结果失败,字段值为 null

因为混淆Gson的bean类字段无法解析:

    private String resultCode;
    private String resultMessage;
    private ResultBean result;
复制代码

Bean=[ resultCode = null , resultMessage = null , result = null]

需要为每个字段添加注解@SerializedName("")

    @SerializedName("resultCode")
    private String resultCode;
    @SerializedName("resultMessage")
    private String resultMessage;
    @SerializedName("result")
    private ResultBean result;
复制代码

转载于:https://juejin.im/post/5a31d4b65188254dd936685c

你可能感兴趣的:(OkHttp + Retrofit 解析请求结果失败,字段值为 null)