springboot2.0不返回某个字段

参考:https://blog.csdn.net/chrise_/article/details/76461061

@Data
public class User implements Serializable{
    private int id;
    private String username;
    @JsonIgnore  //返回时排除掉这个字段
    private String password;
    private String token;
    private String phone;
    private int status;
    private Date create_date;
    private Date update_date;
}

你可能感兴趣的:(spring,boot)