package com.reading.platform.entity;

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

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 课程实体
 * 课程包实体，包含完整的课程管理字段
 */
@Data
@TableName("t_course")
public class Course {

    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    private String tenantId;

    private String name;

    private String code;

    private String description;

    private String coverUrl;

    private String category;

    private String ageRange;

    private String difficultyLevel;

    private Integer durationMinutes;

    private String objectives;

    private String status;

    private Integer isSystem;

    // ============================================
    // 课程包重构字段 (2026-02-28)
    // ============================================

    // 核心内容
    private String coreContent;

    // 课程介绍（8个字段）
    private String introSummary;
    private String introHighlights;
    private String introGoals;
    private String introSchedule;
    private String introKeyPoints;
    private String introMethods;
    private String introEvaluation;
    private String introNotes;

    // 课表参考数据（JSON）
    private String scheduleRefData;

    // 环境创设（步骤7）
    private String environmentConstruction;

    // 主题与绘本关系
    private String themeId;
    private String pictureBookName;

    // 封面图片
    private String coverImagePath;

    // 数字资源（JSON数组）
    private String ebookPaths;
    private String audioPaths;
    private String videoPaths;
    private String otherResources;

    // 教学材料
    private String pptPath;
    private String pptName;
    private String posterPaths;
    private String tools;
    private String studentMaterials;

    // 教案、活动、评估（JSON）
    private String lessonPlanData;
    private String activitiesData;
    private String assessmentData;

    // 年级与领域标签（JSON数组）
    private String gradeTags;
    private String domainTags;

    // 集体课标志
    private Integer hasCollectiveLesson;

    // 版本与审核字段
    private String version;
    private String parentId;
    private Integer isLatest;
    private LocalDateTime submittedAt;
    private Long submittedBy;
    private LocalDateTime reviewedAt;
    private Long reviewedBy;
    private String reviewComment;
    private String reviewChecklist;
    private LocalDateTime publishedAt;

    // 使用统计
    private Integer usageCount;
    private Integer teacherCount;
    private BigDecimal avgRating;

    @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_UPDATE)
    private String updatedBy;

    @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;

    @TableLogic
    private Integer deleted;

}
