自动获取当前时间

@Data
@NoArgsConstructor
public class User{
private Integer id;
private String lastName;
private String email;
private Integer gender; //0:女 1:男
private Date brith;

public User(Integer id, String lastName, String email, Integer gender) {
    this.id = id;
    this.lastName = lastName;
    this.email = email;
    this.gender = gender;
    //创建日期!
    //获取当前时间
    this.brith = new Date();
}

}

posted @ 2020-10-28 11:26  Tenton  阅读(144)  评论(0)    收藏  举报