package com.reading.platform.entity;

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

import java.time.LocalDateTime;

/**
 * 课程资源实体
 */
@Data
@TableName("t_course_resource")
@Schema(description = "课程资源")
public class CourseResource {

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

    private String courseId;

    private String title;

    private String type;

    private String url;

    private String filePath;

    private Long fileSize;

    private Integer duration;

    private String description;

    private Integer sortOrder;

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

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic
    private Integer deleted;

}
