无法从响应获得改造ID

问题描述

您好,我没有从响应中获取ID。 我正在使用翻新。 邮递员的回应如下:

python

发出请求时 用户

{
  "id": 9,"accountGoogleId": "Proov","email": "[email protected]","contact": "588887444","createdAt": "2020-09-09T18:51:59.041+0000","updatedAt": "2020-09-09T18:51:59.041+0000"
}

Onreposne返回accountGoogleId,电子邮件和联系方式,但不返回ID! 我需要从响应中获取ID。试图在用户ID顶部使用int,Integer和@Expose注释

public class User {

    @Serializedname("id")
    @Expose
    private Integer id;

    @Serializedname("accountGoogleId")
    private String accountGoogleId;

    @Serializedname("email")
    private String email;

    @Serializedname("contact")
    private String contact;

    public String getAccountGoogleId() {
        return accountGoogleId;
    }

    public void setAccountGoogleId(String accountGoogleId) {
        this.accountGoogleId = accountGoogleId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)