package com.lingyue.document.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.lingyue.common.domain.entity.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; /** * 文档实体(设计:documents 表) */ @EqualsAndHashCode(callSuper = true) @Data @TableName(value = "documents", autoResultMap = true) @Schema(description = "文档实体") public class Document extends BaseEntity { @Schema(description = "用户ID") @TableField("user_id") private String userId; @Schema(description = "文档名称") @TableField("name") private String name; @Schema(description = "原始文件名") @TableField("file_name") private String fileName; @Schema(description = "存储路径") @TableField("file_path") private String filePath; @Schema(description = "文件大小") @TableField("file_size") private Long fileSize; @Schema(description = "文件类型:pdf/docx") @TableField("file_type") private String fileType; @Schema(description = "状态:uploaded/parsing/parsed/ner_processing/completed/failed") @TableField("status") private String status = "uploaded"; @Schema(description = "解析后的全文") @TableField("parsed_text") private String parsedText; @Schema(description = "页数") @TableField("page_count") private Integer pageCount; @Schema(description = "字数") @TableField("word_count") private Integer wordCount; @Schema(description = "实体数量") @TableField("entity_count") private Integer entityCount = 0; @Schema(description = "关系数量") @TableField("relation_count") private Integer relationCount = 0; @Schema(description = "规则数量") @TableField("rule_count") private Integer ruleCount = 0; @Schema(description = "元数据") @TableField(value = "metadata", typeHandler = JacksonTypeHandler.class) private Object metadata; @Schema(description = "删除标记") @TableField("del_flag") private Boolean delFlag = false; }