package com.test.bijihoudaun.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@Schema(name = "文本实体")
@TableName(value = "`markdown_file`", autoResultMap = true)
public class MarkdownFile implements Serializable {
    @Schema(description = "文本id",implementation = Long.class)
    @TableId(type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    
    @Schema(description = "分组表id",implementation = Long.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("grouping_id")
    private Long groupingId;
    
    @Schema(description = "文本标题",implementation = String.class)
    @TableField("`title`")
    private String title;

    @Schema(description = " 文件名（带.md后缀），用于存储和识别",implementation = String.class)
    @TableField("file_name")
    private String fileName;

    @Schema(description = "Markdown内容，存储实际文档内容",implementation = String.class)
    @TableField("`content`")
    private String content;
    
    @Schema(description = "创建时间",implementation = Date.class)
    @TableField("created_at")
    private Date createdAt;
    
    @Schema(description = "更新时间",implementation = Date.class)
    @TableField("updated_at")
    private Date updatedAt;

    @Schema(description = "是否删除 0-未删除 1-已删除", implementation = Integer.class)
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;

    @Schema(description = "删除时间", implementation = Date.class)
    @TableField("deleted_at")
    private Date deletedAt;

    @Schema(description = "删除人ID", implementation = Long.class)
    @TableField("deleted_by")
    private Long deletedBy;

    @Schema(description = "是否私密 0-公开 1-私密", implementation = Integer.class)
    @TableField("is_private")
    private Integer isPrivate;
}
