package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 课时实体
 */
@Data
@TableName("t_lesson")
@Schema(description = "课时信息")
public class Lesson {

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String id;

    @Schema(description = "租户 ID")
    private String tenantId;

    @Schema(description = "课程 ID")
    private String courseId;

    @Schema(description = "班级 ID")
    private String classId;

    @Schema(description = "教师 ID")
    private String teacherId;

    @Schema(description = "课时标题")
    private String title;

    @Schema(description = "课时日期")
    private LocalDate lessonDate;

    @Schema(description = "开始时间")
    private LocalTime startTime;

    @Schema(description = "结束时间")
    private LocalTime endTime;

    @Schema(description = "上课地点")
    private String location;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "备注说明")
    private String notes;

    /**
     * 实际时长（分钟）
     */
    @Schema(description = "实际时长（分钟）")
    private Integer actualDuration;

    /**
     * 整体评分
     */
    @Schema(description = "整体评分")
    private String overallRating;

    /**
     * 参与度评分
     */
    @Schema(description = "参与度评分")
    private String participationRating;

    /**
     * 完成说明
     */
    @Schema(description = "完成说明")
    private String completionNote;

    @Schema(description = "创建人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @Schema(description = "更新人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @Schema(description = "是否删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
