package com.yj.bean;

/**
 * @author yj
 * @create 2020-08-21 10:41
 */
public class User {
    // 用户ID，使用Integer类型以便于处理数据库中的null值
    private Integer id;
    // 用户名
    private String username;
    // 密码
    private String password;
    // 邮箱地址
    private String email;
    // 用户地址
    private String address;

    // 获取用户地址
    public String getAddress() {
        return address;
    }

    // 设置用户地址
    public void setAddress(String address) {
        this.address = address;
    }

    // 获取用户ID
    public Integer getId() {
        return id;
    }

    // 设置用户ID
    public void setId(Integer id) {
        this.id = id;
    }

    // 获取用户名
    public String getUsername() {
        return username;
    }

    // 设置用户名
    public void setUsername(String username) {
        this.username = username;
    }

    // 获取密码
    public String getPassword() {
        return password;
    }

    // 设置密码
    public void setPassword(String password) {
        this.password = password;
    }

    // 获取邮箱
    public String getEmail() {
        return email;
    }

    // 设置邮箱
    public void setEmail(String email) {
        this.email = email;
    }

    // 重写toString方法，方便输出用户信息
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    // 无参构造函数
    public User() {
    }

    // 带参数的构造函数，用于创建用户对象时初始化属性
    public User(Integer id, String username, String password, String email, String address) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.address = address;
    }
}

