package cn.ppdxzz.domain;

import java.io.Serializable;

/**
 * Student类表示一个学生对象，包含学生的基本信息和状态。
 * 该类实现了Serializable接口，允许其对象被序列化。
 */
public class Student implements Serializable {
    private Integer id; // 学生的唯一标识符
    private String name; // 学生的姓名
    private String sex; // 学生的性别
    private String sno; // 学生的学号
    private String stu_class; // 学生所在的班级
    private String phone; // 学生的联系电话
    private String place; // 学生的家庭住址
    private String dorm_id; // 学生宿舍的编号
    private String teacher; // 负责学生育人导师的名字
    private Integer status; // 学生的状态：1表示激活，0表示禁用

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

    // 全参构造函数，用于创建具有所有属性的学生对象
    public Student(Integer id, String name, String sex, String sno, String stu_class, String phone, String place, String dorm_id, String teacher, Integer status) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.sno = sno;
        this.stu_class = stu_class;
        this.phone = phone;
        this.place = place;
        this.dorm_id = dorm_id;
        this.teacher = teacher;
        this.status = status;
    }

    // Getter和Setter方法用于访问和修改私有属性
    public Integer getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public String getStu_class() {
        return stu_class;
    }

    public void setStu_class(String stu_class) {
        this.stu_class = stu_class;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getDorm_id() {
        return dorm_id;
    }

    public void setDorm_id(String dorm_id) {
        this.dorm_id = dorm_id;
    }

    public String getTeacher() {
        return teacher;
    }

    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    // toString方法用于返回对象的字符串表示形式，便于调试和日志记录
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", sno='" + sno + '\'' +
                ", stu_class='" + stu_class + '\'' +
                ", phone='" + phone + '\'' +
                ", place='" + place + '\'' +
                ", dorm_id='" + dorm_id + '\'' +
                ", teacher='" + teacher + '\'' +
                ", status=" + status +
                '}';
    }
}
