package rd.data.db.table;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.base.Objects;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName(autoResultMap = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CourseSchedule implements Serializable {
    /**
     * 课堂id
     */
    private Long id;

    /**
     * 课程id
     */
    private Long course;

    /**
     * 开始周
     */
    private Integer startWeek;

    /**
     * 结束周
     */
    private Integer endWeek;

    /**
     * 节次时间,即第几节课
     */
    private Integer time;

    /**
     * 节次时间,即第几节课
     */
    private Integer weekday;

    /**
     * 学年学期,格式如2023-2024
     */
    private String academicTerm;

    /**
     * 上课地点
     */
    private String place;

    /**
     * create_time
     */
    private LocalDateTime createTime;

    /**
     * edit_time
     */
    private LocalDateTime editTime;

    /**
     * delete
     */
    private Boolean deleted;

    public CourseSchedule() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CourseSchedule that = (CourseSchedule) o;
        return Objects.equal(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }
}
