改进GSON对象为空

时间:2014-11-15 20:37:54

标签: android gson retrofit

我正在我的项目中使用改造,并且我已经为响应制作了一个GSON对象。 但该对象只包含空值。

UserRespomse.java

package model;

import com.google.gson.annotations.SerializedName;

public class UserResponse {
    @SerializedName("status") private int mStatus;
    @SerializedName("details") private User mUser;
    @SerializedName("reason") private String mReason;

    public int getStatus() {
        return mStatus;
    }

    public User getUser() {
        return mUser;
    }

    public String getReason() {
        return mReason;
    }
}

UsersService.java

@GET("/users/{email}/auth/{password}")
void login(@Path(value="email", encode = false) String email, @Path("password") String password,
        Callback<UserResponse> callback);

JSON返回

{"status":200,"details":{"id":1,"email":"orelzion@gmail.com","first_name":"Orel","last_name":"Zion","password":"$2a$10$eHAs0nh0XPsle3ZntjpMYucboMBGcwWpC0mrsNUuBClWXWTUR41w2","created_at":"2014-11-10T08:56:34-05:00","updated_at":"2014-11-10T08:58:01-05:00","facebook_token":null,"facebook_token_updated_at":null,"user_key":"9e38432ec505e1461efe3277ee57bc9025d50270","apps":[],"url":"/users/1"},"reason":""}

可能是什么原因,或者我如何看到GSON日志?

由于

0 个答案:

没有答案