package org.hzhub.domain.bo.knowledge;

import org.hzhub.common.core.validate.AddGroup;
import org.hzhub.common.core.validate.EditGroup;
import org.hzhub.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import org.hzhub.domain.entity.knowledge.KnowledgeGraphSegment;

/**
 * 知识图谱片段业务对象 knowledge_graph_segment
 *
 * @author ageerle
 * @date 2025-12-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = KnowledgeGraphSegment.class, reverseConvertGenerate = false)
public class KnowledgeGraphSegmentBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 片段UUID
     */
    @NotBlank(message = "片段UUID不能为空", groups = { AddGroup.class, EditGroup.class })
    private String uuid;

    /**
     * 知识库UUID
     */
    @NotBlank(message = "知识库UUID不能为空", groups = { AddGroup.class, EditGroup.class })
    private String kbUuid;

    /**
     * 知识库条目UUID
     */
    private String kbItemUuid;

    /**
     * 文档UUID
     */
    private String docUuid;

    /**
     * 片段文本内容
     */
    private String segmentText;

    /**
     * 片段索引（第几个片段）
     */
    private Long chunkIndex;

    /**
     * 总片段数
     */
    private Long totalChunks;

    /**
     * 抽取状态：0-待处理 1-处理中 2-已完成 3-失败
     */
    private Long extractionStatus;

    /**
     * 抽取的实体数量
     */
    private Long entityCount;

    /**
     * 抽取的关系数量
     */
    private Long relationCount;

    /**
     * 消耗的token数
     */
    private Long tokenUsed;

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 备注
     */
    private String remark;


}
