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_task_template")
@Schema(description = "任务模板信息")
public class TaskTemplate {

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

    @Schema(description = "租户 ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String tenantId;

    @Schema(description = "模板名称", example = "阅读打卡模板", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @Schema(description = "模板描述")
    private String description;

    @Schema(description = "任务类型", example = "reading", allowableValues = {"reading", "writing", "oral", "other"})
    private String type;

    @Schema(description = "模板内容")
    private String content;

    @Schema(description = "是否公共模板", example = "1")
    private Integer isPublic;

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

    @Schema(description = "逻辑删除标志", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
