package com.qmth.teachcloud.common.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 老师和课程关联表
 * </p>
 *
 * @author wangliang
 * @since 2023-04-24
 */
@ApiModel(value = "BasicTeachCourse对象", description = "老师和课程关联表")
public class BasicTeachCourse extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学校id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long schoolId;

    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orgId;

    @ApiModelProperty(value = "用户ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "课程ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long courseId;

    @ApiModelProperty(value = "是否启用？1-是 ；0-否")
    private Boolean enable = true;

    public BasicTeachCourse() {

    }

    public BasicTeachCourse(SysUser sysUser,Long courseId, Long teachId) {
        setSchoolId(sysUser.getSchoolId());
        setOrgId(sysUser.getOrgId());
        setCourseId(courseId);
        setUserId(teachId);
        insertInfo(sysUser.getId());
        updateInfo(sysUser.getId());
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
