mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-14 04:13:39 +00:00
v3.0.0 init
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package org.ruoyi.domain.bo.chat;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.domain.entity.chat.ChatConfig;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 配置信息业务对象 chat_config
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ChatConfig.class, reverseConvertGenerate = false)
|
||||
public class ChatConfigBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
@NotBlank(message = "配置类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
@NotBlank(message = "配置名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@NotBlank(message = "配置值不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String configDict;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.ruoyi.domain.bo.chat;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.domain.entity.chat.ChatMessage;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 聊天消息业务对象 chat_message
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ChatMessage.class, reverseConvertGenerate = false)
|
||||
public class ChatMessageBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 对话角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* 扣除金额
|
||||
*/
|
||||
private Long deductCost;
|
||||
|
||||
/**
|
||||
* 累计 Tokens
|
||||
*/
|
||||
private Long totalTokens;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 计费类型(1-token计费,2-次数计费)
|
||||
*/
|
||||
private String billingType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package org.ruoyi.domain.bo.chat;
|
||||
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.domain.entity.chat.ChatModel;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 模型管理业务对象 chat_model
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ChatModel.class, reverseConvertGenerate = false)
|
||||
public class ChatModelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模型分类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型供应商
|
||||
*/
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 模型描述
|
||||
*/
|
||||
private String modelDescribe;
|
||||
|
||||
/**
|
||||
* 模型价格
|
||||
*/
|
||||
private Long modelPrice;
|
||||
|
||||
/**
|
||||
* 计费类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
private String modelShow;
|
||||
|
||||
/**
|
||||
* 是否免费
|
||||
*/
|
||||
private String modelFree;
|
||||
|
||||
/**
|
||||
* 模型优先级(值越大优先级越高)
|
||||
*/
|
||||
private Long priority;
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.ruoyi.domain.bo.chat;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.domain.entity.chat.ChatProvider;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 厂商管理业务对象 chat_provider
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ChatProvider.class, reverseConvertGenerate = false)
|
||||
public class ChatProviderBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 厂商名称
|
||||
*/
|
||||
@NotBlank(message = "厂商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 厂商编码
|
||||
*/
|
||||
@NotBlank(message = "厂商编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 厂商图标
|
||||
*/
|
||||
private String providerIcon;
|
||||
|
||||
/**
|
||||
* 厂商描述
|
||||
*/
|
||||
private String providerDesc;
|
||||
|
||||
/**
|
||||
* API地址
|
||||
*/
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.ruoyi.domain.bo.chat;
|
||||
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.domain.entity.chat.ChatSession;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 会话管理业务对象 chat_session
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ChatSession.class, reverseConvertGenerate = false)
|
||||
public class ChatSessionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 会话标题
|
||||
*/
|
||||
private String sessionTitle;
|
||||
|
||||
/**
|
||||
* 会话内容
|
||||
*/
|
||||
private String sessionContent;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String conversationId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 图谱构建任务对象 graph_build_task
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("graph_build_task")
|
||||
public class GraphBuildTask extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务UUID
|
||||
*/
|
||||
private String taskUuid;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 文档ID(可选,null表示全量构建)
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 任务类型:1全量构建、2增量更新、3重建
|
||||
*/
|
||||
private Integer taskType;
|
||||
|
||||
/**
|
||||
* 任务状态:1待执行、2执行中、3成功、4失败
|
||||
*/
|
||||
private Integer taskStatus;
|
||||
|
||||
/**
|
||||
* 进度百分比(0-100)
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 总文档数
|
||||
*/
|
||||
private Integer totalDocs;
|
||||
|
||||
/**
|
||||
* 已处理文档数
|
||||
*/
|
||||
private Integer processedDocs;
|
||||
|
||||
/**
|
||||
* 提取的实体数
|
||||
*/
|
||||
private Integer extractedEntities;
|
||||
|
||||
/**
|
||||
* 提取的关系数
|
||||
*/
|
||||
private Integer extractedRelations;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 结果摘要(JSON格式)
|
||||
*/
|
||||
private String resultSummary;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 图关系实体
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("graph_edge")
|
||||
public class GraphEdge implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 关系唯一标识(Neo4j中的关系ID)
|
||||
*/
|
||||
private String edgeId;
|
||||
|
||||
/**
|
||||
* 关系标签(类型)
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 源节点ID
|
||||
*/
|
||||
private String sourceNodeId;
|
||||
|
||||
/**
|
||||
* 源节点名称
|
||||
*/
|
||||
private String sourceName;
|
||||
|
||||
/**
|
||||
* 目标节点ID
|
||||
*/
|
||||
private String targetNodeId;
|
||||
|
||||
/**
|
||||
* 目标节点名称
|
||||
*/
|
||||
private String targetName;
|
||||
|
||||
/**
|
||||
* 关系类型编码
|
||||
*/
|
||||
private String relationType;
|
||||
|
||||
/**
|
||||
* 关系描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 关系权重(0.0-1.0)
|
||||
*/
|
||||
private Double weight;
|
||||
|
||||
/**
|
||||
* 置信度(0.0-1.0)
|
||||
*/
|
||||
private Double confidence;
|
||||
|
||||
/**
|
||||
* 来源知识库ID
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 来源文档ID列表(JSON格式)
|
||||
*/
|
||||
private String docIds;
|
||||
|
||||
/**
|
||||
* 来源片段ID列表(JSON格式)
|
||||
*/
|
||||
private String fragmentIds;
|
||||
|
||||
/**
|
||||
* 文本段ID(关联到具体的文本段)
|
||||
*/
|
||||
@JsonProperty("text_segment_id")
|
||||
private String textSegmentId;
|
||||
|
||||
/**
|
||||
* 其他属性(JSON格式)
|
||||
*/
|
||||
private String properties;
|
||||
|
||||
/**
|
||||
* 元数据(JSON格式)
|
||||
*/
|
||||
private Map<String, Object> metadata;
|
||||
|
||||
/**
|
||||
* 源节点元数据
|
||||
*/
|
||||
private Map<String, Object> sourceMetadata;
|
||||
|
||||
/**
|
||||
* 目标节点元数据
|
||||
*/
|
||||
private Map<String, Object> targetMetadata;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 图谱实体类型定义对象 graph_entity_type
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("graph_entity_type")
|
||||
public class GraphEntityType extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 实体类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 可视化颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否启用(0否 1是)
|
||||
*/
|
||||
private Integer isEnable;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识图谱实例对象 knowledge_graph_instance
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_graph_instance")
|
||||
public class GraphInstance extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 关联knowledge_info.kid
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 图谱名称
|
||||
*/
|
||||
private String graphName;
|
||||
|
||||
/**
|
||||
* 图谱实例名称(前端使用,不映射到数据库)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String instanceName;
|
||||
|
||||
/**
|
||||
* 构建状态:10构建中、20已完成、30失败
|
||||
*/
|
||||
private Integer graphStatus;
|
||||
|
||||
/**
|
||||
* 节点数量
|
||||
*/
|
||||
private Integer nodeCount;
|
||||
|
||||
/**
|
||||
* 关系数量
|
||||
*/
|
||||
private Integer relationshipCount;
|
||||
|
||||
/**
|
||||
* 图谱配置(JSON格式)
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* LLM模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 实体类型(逗号分隔)
|
||||
*/
|
||||
private String entityTypes;
|
||||
|
||||
/**
|
||||
* 关系类型(逗号分隔)
|
||||
*/
|
||||
private String relationTypes;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 获取实例名称(兼容前端)
|
||||
*/
|
||||
public String getInstanceName() {
|
||||
return instanceName != null ? instanceName : graphName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置实例名称(同步到graphName)
|
||||
*/
|
||||
public void setInstanceName(String instanceName) {
|
||||
this.instanceName = instanceName;
|
||||
this.graphName = instanceName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 图谱关系类型定义对象 graph_relation_type
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("graph_relation_type")
|
||||
public class GraphRelationType extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关系名称
|
||||
*/
|
||||
private String relationName;
|
||||
|
||||
/**
|
||||
* 关系编码
|
||||
*/
|
||||
private String relationCode;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 关系方向:0双向、1单向
|
||||
*/
|
||||
private Integer direction;
|
||||
|
||||
/**
|
||||
* 可视化样式(JSON格式)
|
||||
*/
|
||||
private String style;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否启用(0否 1是)
|
||||
*/
|
||||
private Integer isEnable;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 图节点实体
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("graph_vertex")
|
||||
public class GraphVertex implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 节点唯一标识(Neo4j中的节点ID)
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 节点标签(类型)
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 节点类型编码
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 置信度(0.0-1.0)
|
||||
*/
|
||||
private Double confidence;
|
||||
|
||||
/**
|
||||
* 来源知识库ID
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 来源文档ID列表(JSON格式)
|
||||
*/
|
||||
private String docIds;
|
||||
|
||||
/**
|
||||
* 来源片段ID列表(JSON格式)
|
||||
*/
|
||||
private String fragmentIds;
|
||||
|
||||
/**
|
||||
* 文本段ID(关联到具体的文本段)
|
||||
*/
|
||||
@JsonProperty("text_segment_id")
|
||||
private String textSegmentId;
|
||||
|
||||
/**
|
||||
* 别名列表(JSON格式)
|
||||
*/
|
||||
private String aliases;
|
||||
|
||||
/**
|
||||
* 其他属性(JSON格式)
|
||||
*/
|
||||
private String properties;
|
||||
|
||||
/**
|
||||
* 元数据(JSON格式)
|
||||
*/
|
||||
private Map<String, Object> metadata;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.ruoyi.domain.bo.graph;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识图谱片段实体
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_base_graph_segment")
|
||||
public class KnowledgeBaseGraphSegment extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 片段UUID
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 知识库UUID
|
||||
*/
|
||||
private String kbUuid;
|
||||
|
||||
/**
|
||||
* 知识库条目UUID
|
||||
*/
|
||||
private String kbItemUuid;
|
||||
|
||||
/**
|
||||
* 文档UUID
|
||||
*/
|
||||
private String docUuid;
|
||||
|
||||
/**
|
||||
* 片段文本内容
|
||||
*/
|
||||
private String segmentText;
|
||||
|
||||
/**
|
||||
* 片段索引(第几个片段)
|
||||
*/
|
||||
private Integer chunkIndex;
|
||||
|
||||
/**
|
||||
* 总片段数
|
||||
*/
|
||||
private Integer totalChunks;
|
||||
|
||||
/**
|
||||
* 抽取状态:0-待处理 1-处理中 2-已完成 3-失败
|
||||
*/
|
||||
private Integer extractionStatus;
|
||||
|
||||
/**
|
||||
* 抽取的实体数量
|
||||
*/
|
||||
private Integer entityCount;
|
||||
|
||||
/**
|
||||
* 抽取的关系数量
|
||||
*/
|
||||
private Integer relationCount;
|
||||
|
||||
/**
|
||||
* 消耗的token数
|
||||
*/
|
||||
private Integer tokenUsed;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeAttach;
|
||||
|
||||
/**
|
||||
* 知识库附件业务对象 knowledge_attach
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = KnowledgeAttach.class, reverseConvertGenerate = false)
|
||||
public class KnowledgeAttachBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
@NotBlank(message = "知识库ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long knowledgeId;
|
||||
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 附件类型
|
||||
*/
|
||||
@NotBlank(message = "附件类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 对象存储ID
|
||||
*/
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeFragment;
|
||||
|
||||
/**
|
||||
* 知识片段业务对象 knowledge_fragment
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = KnowledgeFragment.class, reverseConvertGenerate = false)
|
||||
public class KnowledgeFragmentBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
|
||||
/**
|
||||
* 片段索引下标
|
||||
*/
|
||||
@NotNull(message = "片段索引下标不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer idx;
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
@NotBlank(message = "文档内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeGraphInstance;
|
||||
|
||||
/**
|
||||
* 知识图谱实例业务对象 knowledge_graph_instance
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = KnowledgeGraphInstance.class, reverseConvertGenerate = false)
|
||||
public class KnowledgeGraphInstanceBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
@NotBlank(message = "图谱UUID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 关联knowledge_info.kid
|
||||
*/
|
||||
@NotBlank(message = "关联knowledge_info.kid不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 图谱名称
|
||||
*/
|
||||
@NotBlank(message = "图谱名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String graphName;
|
||||
|
||||
/**
|
||||
* 构建状态:10构建中、20已完成、30失败
|
||||
*/
|
||||
private Long graphStatus;
|
||||
|
||||
/**
|
||||
* 节点数量
|
||||
*/
|
||||
private Long nodeCount;
|
||||
|
||||
/**
|
||||
* 关系数量
|
||||
*/
|
||||
private Long relationshipCount;
|
||||
|
||||
/**
|
||||
* 图谱配置(JSON格式)
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* LLM模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 实体类型(逗号分隔)
|
||||
*/
|
||||
private String entityTypes;
|
||||
|
||||
/**
|
||||
* 关系类型(逗号分隔)
|
||||
*/
|
||||
private String relationTypes;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.ruoyi.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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeInfo;
|
||||
|
||||
/**
|
||||
* 知识库业务对象 knowledge_info
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = KnowledgeInfo.class, reverseConvertGenerate = false)
|
||||
public class KnowledgeInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 知识库名称
|
||||
*/
|
||||
@NotBlank(message = "知识库名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否公开知识库(0 否 1是)
|
||||
*/
|
||||
private Long share;
|
||||
|
||||
/**
|
||||
* 知识库描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 知识分隔符
|
||||
*/
|
||||
private String separator;
|
||||
|
||||
/**
|
||||
* 重叠字符数
|
||||
*/
|
||||
private Long overlapChar;
|
||||
|
||||
/**
|
||||
* 知识库中检索的条数
|
||||
*/
|
||||
private Long retrieveLimit;
|
||||
|
||||
/**
|
||||
* 文本块大小
|
||||
*/
|
||||
private Long textBlockSize;
|
||||
|
||||
/**
|
||||
* 向量库
|
||||
*/
|
||||
private String vectorModel;
|
||||
|
||||
/**
|
||||
* 向量模型
|
||||
*/
|
||||
private String embeddingModel;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.ruoyi.domain.bo.knowledge;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 附件上传请求
|
||||
*/
|
||||
@Data
|
||||
public class KnowledgeInfoUploadBo {
|
||||
|
||||
private Long knowledgeId;
|
||||
|
||||
private MultipartFile file;
|
||||
|
||||
/**
|
||||
* 生效时间, 为空则立即生效
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.ruoyi.domain.bo.vector;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询向量所需参数
|
||||
*
|
||||
* @author ageer
|
||||
*/
|
||||
@Data
|
||||
public class QueryVectorBo {
|
||||
|
||||
/**
|
||||
* 查询内容
|
||||
*/
|
||||
private String query;
|
||||
|
||||
/**
|
||||
* 知识库kid
|
||||
*/
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 查询向量返回条数
|
||||
*/
|
||||
private Integer maxResults;
|
||||
|
||||
/**
|
||||
* 向量库模型名称
|
||||
*/
|
||||
private String vectorModelName;
|
||||
|
||||
/**
|
||||
* 向量化模型ID
|
||||
*/
|
||||
private Long embeddingModelId;
|
||||
|
||||
/**
|
||||
* 向量化模型ID
|
||||
*/
|
||||
private String embeddingModelName;
|
||||
|
||||
/**
|
||||
* 请求key
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String baseUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.ruoyi.domain.bo.vector;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保存向量所需参数
|
||||
*
|
||||
* @author ageer
|
||||
*/
|
||||
@Data
|
||||
public class StoreEmbeddingBo {
|
||||
|
||||
/**
|
||||
* 切分文本块列表
|
||||
*/
|
||||
private List<String> chunkList;
|
||||
|
||||
/**
|
||||
* 知识库kid
|
||||
*/
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 文档id
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 知识块id列表
|
||||
*/
|
||||
private List<String> fids;
|
||||
|
||||
/**
|
||||
* 向量库名称
|
||||
*/
|
||||
private String vectorStoreName;
|
||||
|
||||
/**
|
||||
* 向量化模型id
|
||||
*/
|
||||
private Long embeddingModelId;
|
||||
|
||||
/**
|
||||
* 向量化模型名称
|
||||
*/
|
||||
private String embeddingModelName;
|
||||
|
||||
/**
|
||||
* 请求key
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String baseUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.ruoyi.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 聊天消息DTO - 用于上下文传递
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025/12/13
|
||||
*/
|
||||
@Data
|
||||
public class ChatMessageDTO {
|
||||
|
||||
/**
|
||||
* 消息角色: system/user/assistant
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
public static ChatMessageDTO system(String content) {
|
||||
ChatMessageDTO msg = new ChatMessageDTO();
|
||||
msg.role = "system";
|
||||
msg.content = content;
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static ChatMessageDTO user(String content) {
|
||||
ChatMessageDTO msg = new ChatMessageDTO();
|
||||
msg.role = "user";
|
||||
msg.content = content;
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static ChatMessageDTO assistant(String content) {
|
||||
ChatMessageDTO msg = new ChatMessageDTO();
|
||||
msg.role = "assistant";
|
||||
msg.content = content;
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.ruoyi.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 抽取的实体
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ExtractedEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 实体名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 实体类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 实体描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 置信度(0.0-1.0)
|
||||
*/
|
||||
private Double confidence;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.ruoyi.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 抽取的关系
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ExtractedRelation implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 源实体名称
|
||||
*/
|
||||
private String sourceEntity;
|
||||
|
||||
/**
|
||||
* 目标实体名称
|
||||
*/
|
||||
private String targetEntity;
|
||||
|
||||
/**
|
||||
* 关系描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 关系强度(0-10)
|
||||
*/
|
||||
private Integer strength;
|
||||
|
||||
/**
|
||||
* 置信度(0.0-1.0)
|
||||
*/
|
||||
private Double confidence;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.ruoyi.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图谱抽取结果
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GraphExtractionResult implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 抽取的实体列表
|
||||
*/
|
||||
private List<ExtractedEntity> entities;
|
||||
|
||||
/**
|
||||
* 抽取的关系列表
|
||||
*/
|
||||
private List<ExtractedRelation> relations;
|
||||
|
||||
/**
|
||||
* 原始LLM响应
|
||||
*/
|
||||
private String rawResponse;
|
||||
|
||||
/**
|
||||
* 消耗的token数
|
||||
*/
|
||||
private Integer tokenUsed;
|
||||
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
private Boolean success;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.ruoyi.domain.dto;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: Robust_H
|
||||
* @Date: 2025-09-30-下午2:13
|
||||
* @Description: 多模态输入
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class MultiModalInput {
|
||||
private String text;
|
||||
private byte[] imageData;
|
||||
private byte[] videoData;
|
||||
private String imageMimeType;
|
||||
private String videoMimeType;
|
||||
private String[] multiImageUrls;
|
||||
private String imageUrl;
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 检查是否有文本内容
|
||||
*/
|
||||
public boolean hasText() {
|
||||
return StrUtil.isNotBlank(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有图片内容
|
||||
*/
|
||||
public boolean hasImage() {
|
||||
return ArrayUtil.isNotEmpty(imageData) || StrUtil.isNotBlank(imageUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有视频内容
|
||||
*/
|
||||
public boolean hasVideo() {
|
||||
return ArrayUtil.isNotEmpty(videoData) || StrUtil.isNotBlank(videoUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有多图片
|
||||
*/
|
||||
public boolean hasMultiImages() {
|
||||
return ArrayUtil.isNotEmpty(multiImageUrls);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有任何内容
|
||||
*/
|
||||
public boolean hasAnyContent() {
|
||||
return hasText() || hasImage() || hasVideo() || hasMultiImages();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内容的数量
|
||||
*/
|
||||
public int getContentCount() {
|
||||
int count = 0;
|
||||
if (hasText()) count++;
|
||||
if (hasImage()) count++;
|
||||
if (hasVideo()) count++;
|
||||
if (hasMultiImages()) count++;
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.ruoyi.domain.dto.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.ruoyi.common.json.utils.JsonUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: Robust_H
|
||||
* @Date: 2025-10-1-上午10:00
|
||||
* @Description: 阿里云多模态嵌入请求
|
||||
*/
|
||||
@Data
|
||||
public class AliyunMultiModalEmbedRequest {
|
||||
private String model;
|
||||
private Input input;
|
||||
|
||||
/**
|
||||
* 创建请求对象
|
||||
*/
|
||||
public static AliyunMultiModalEmbedRequest create(String modelName, List<Map<String, Object>> contents) {
|
||||
AliyunMultiModalEmbedRequest request = new AliyunMultiModalEmbedRequest();
|
||||
request.setModel(modelName);
|
||||
Input input = new Input(contents);
|
||||
request.setInput(input);
|
||||
return request;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为JSON字符串
|
||||
*/
|
||||
public String toJson() {
|
||||
return JsonUtils.toJsonString(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表示输入数据的记录类(Record)
|
||||
* 该类用于封装一个包含多个映射关系列表的输入数据结构
|
||||
*
|
||||
* @param contents 包含多个Map的列表,每个Map中存储String类型的键和Object类型的值
|
||||
*/
|
||||
public record Input(List<Map<String, Object>> contents) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.ruoyi.domain.dto.request;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.dto.ChatMessageDTO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对话请求对象
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2023-04-08
|
||||
*/
|
||||
@Data
|
||||
public class ChatRequest {
|
||||
|
||||
@NotEmpty(message = "对话消息不能为空")
|
||||
private List<ChatMessageDTO> messages;
|
||||
|
||||
@NotEmpty(message = "传入的模型不能为空")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 知识库id
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 对话id(每个聊天窗口都不一样)
|
||||
*/
|
||||
private Long uuid;
|
||||
|
||||
/**
|
||||
* 是否启用深度思考
|
||||
*/
|
||||
private Boolean enableThinking;
|
||||
|
||||
/**
|
||||
* 是否自动切换模型
|
||||
*/
|
||||
private Boolean autoSelectModel;
|
||||
|
||||
/**
|
||||
* 是否支持联网
|
||||
*/
|
||||
private Boolean enableInternet;
|
||||
|
||||
/**
|
||||
* 会话令牌(为避免在非Web线程中获取Request,入口处注入)
|
||||
*/
|
||||
private String token;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.ruoyi.domain.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 阿里云多模态嵌入 API 响应数据模型
|
||||
*/
|
||||
public record AliyunMultiModalEmbedResponse(
|
||||
Output output, // 输出结果对象
|
||||
String request_id, // 请求唯一标识
|
||||
String code, // 错误码
|
||||
String message, // 错误消息
|
||||
Usage usage // 用量信息
|
||||
) {
|
||||
|
||||
/**
|
||||
* 输出对象,包含嵌入向量结果
|
||||
*/
|
||||
public record Output(
|
||||
List<EmbeddingItem> embeddings // 嵌入向量列表
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个嵌入向量条目
|
||||
*/
|
||||
public record EmbeddingItem(
|
||||
int index, // 输入内容的索引
|
||||
List<Double> embedding, // 生成的 1024 维向量
|
||||
String type // 输入的类型 (text/image/video/multi_images)
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 用量统计信息
|
||||
*/
|
||||
public record Usage(
|
||||
int input_tokens, // 本次请求输入的 Token 数量
|
||||
int image_tokens, // 本次请求输入的图像 Token 数量
|
||||
int image_count, // 本次请求输入的图像数量
|
||||
int duration // 本次请求输入的视频时长(秒)
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.ruoyi.domain.entity.chat;
|
||||
|
||||
import org.ruoyi.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 配置信息对象 chat_config
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("chat_config")
|
||||
public class ChatConfig extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String configDict;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.ruoyi.domain.entity.chat;
|
||||
|
||||
import org.ruoyi.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 聊天消息对象 chat_message
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("chat_message")
|
||||
public class ChatMessage extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 对话角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* 扣除金额
|
||||
*/
|
||||
private Long deductCost;
|
||||
|
||||
/**
|
||||
* 累计 Tokens
|
||||
*/
|
||||
private Long totalTokens;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 计费类型(1-token计费,2-次数计费)
|
||||
*/
|
||||
private String billingType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.ruoyi.domain.entity.chat;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 模型管理对象 chat_model
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("chat_model")
|
||||
public class ChatModel extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模型分类
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型供应商
|
||||
*/
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 模型描述
|
||||
*/
|
||||
private String modelDescribe;
|
||||
|
||||
/**
|
||||
* 模型价格
|
||||
*/
|
||||
private Long modelPrice;
|
||||
|
||||
/**
|
||||
* 计费类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
private String modelShow;
|
||||
|
||||
/**
|
||||
* 是否免费
|
||||
*/
|
||||
private String modelFree;
|
||||
|
||||
/**
|
||||
* 模型优先级(值越大优先级越高)
|
||||
*/
|
||||
private Long priority;
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.ruoyi.domain.entity.chat;
|
||||
|
||||
import org.ruoyi.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 厂商管理对象 chat_provider
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("chat_provider")
|
||||
public class ChatProvider extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 厂商名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 厂商编码
|
||||
*/
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 厂商图标
|
||||
*/
|
||||
private String providerIcon;
|
||||
|
||||
/**
|
||||
* 厂商描述
|
||||
*/
|
||||
private String providerDesc;
|
||||
|
||||
/**
|
||||
* API地址
|
||||
*/
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.ruoyi.domain.entity.chat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 会话管理对象 chat_session
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("chat_session")
|
||||
public class ChatSession extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 会话标题
|
||||
*/
|
||||
private String sessionTitle;
|
||||
|
||||
/**
|
||||
* 会话内容
|
||||
*/
|
||||
private String sessionContent;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String conversationId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.ruoyi.domain.entity.knowledge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识库附件对象 knowledge_attach
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_attach")
|
||||
public class KnowledgeAttach extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
private Long knowledgeId;
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 附件类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 对象存储ID
|
||||
*/
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.ruoyi.domain.entity.knowledge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识片段对象 knowledge_fragment
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_fragment")
|
||||
public class KnowledgeFragment extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 片段索引下标
|
||||
*/
|
||||
private Integer idx;
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.ruoyi.domain.entity.knowledge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识图谱实例对象 knowledge_graph_instance
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_graph_instance")
|
||||
public class KnowledgeGraphInstance extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 关联knowledge_info.kid
|
||||
*/
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 图谱名称
|
||||
*/
|
||||
private String graphName;
|
||||
|
||||
/**
|
||||
* 构建状态:10构建中、20已完成、30失败
|
||||
*/
|
||||
private Long graphStatus;
|
||||
|
||||
/**
|
||||
* 节点数量
|
||||
*/
|
||||
private Long nodeCount;
|
||||
|
||||
/**
|
||||
* 关系数量
|
||||
*/
|
||||
private Long relationshipCount;
|
||||
|
||||
/**
|
||||
* 图谱配置(JSON格式)
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* LLM模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 实体类型(逗号分隔)
|
||||
*/
|
||||
private String entityTypes;
|
||||
|
||||
/**
|
||||
* 关系类型(逗号分隔)
|
||||
*/
|
||||
private String relationTypes;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package org.ruoyi.domain.entity.knowledge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识图谱片段对象 knowledge_graph_segment
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_graph_segment")
|
||||
public class KnowledgeGraphSegment extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 片段UUID
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 知识库UUID
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.ruoyi.domain.entity.knowledge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 知识库对象 knowledge_info
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("knowledge_info")
|
||||
public class KnowledgeInfo extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 知识库名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否公开知识库(0 否 1是)
|
||||
*/
|
||||
private Long share;
|
||||
|
||||
/**
|
||||
* 知识库描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 知识分隔符
|
||||
*/
|
||||
@TableField(value = "`separator`")
|
||||
private String separator;
|
||||
|
||||
/**
|
||||
* 重叠字符数
|
||||
*/
|
||||
private Long overlapChar;
|
||||
|
||||
/**
|
||||
* 知识库中检索的条数
|
||||
*/
|
||||
private Long retrieveLimit;
|
||||
|
||||
/**
|
||||
* 文本块大小
|
||||
*/
|
||||
private Long textBlockSize;
|
||||
|
||||
/**
|
||||
* 向量库
|
||||
*/
|
||||
private String vectorModel;
|
||||
|
||||
/**
|
||||
* 向量模型
|
||||
*/
|
||||
private String embeddingModel;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.ruoyi.domain.vo.chat;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.chat.ChatConfig;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 配置信息视图对象 chat_config
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ChatConfig.class)
|
||||
public class ChatConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
@ExcelProperty(value = "配置类型")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
@ExcelProperty(value = "配置名称")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@ExcelProperty(value = "配置值")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@ExcelProperty(value = "说明")
|
||||
private String configDict;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@ExcelProperty(value = "更新IP")
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.ruoyi.domain.vo.chat;
|
||||
|
||||
import org.ruoyi.domain.entity.chat.ChatMessage;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天消息视图对象 chat_message
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ChatMessage.class)
|
||||
public class ChatMessageVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
@ExcelProperty(value = "会话id")
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@ExcelProperty(value = "消息内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 对话角色
|
||||
*/
|
||||
@ExcelProperty(value = "对话角色")
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* 扣除金额
|
||||
*/
|
||||
@ExcelProperty(value = "扣除金额")
|
||||
private Long deductCost;
|
||||
|
||||
/**
|
||||
* 累计 Tokens
|
||||
*/
|
||||
@ExcelProperty(value = "累计 Tokens")
|
||||
private Long totalTokens;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
@ExcelProperty(value = "模型名称")
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 计费类型(1-token计费,2-次数计费)
|
||||
*/
|
||||
@ExcelProperty(value = "计费类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "1=-token计费,2-次数计费")
|
||||
private String billingType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.ruoyi.domain.vo.chat;
|
||||
|
||||
import org.ruoyi.domain.entity.chat.ChatModel;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 模型管理视图对象 chat_model
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ChatModel.class)
|
||||
public class ChatModelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模型分类
|
||||
*/
|
||||
@ExcelProperty(value = "模型分类")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
@ExcelProperty(value = "模型名称")
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型供应商
|
||||
*/
|
||||
@ExcelProperty(value = "模型供应商")
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 模型描述
|
||||
*/
|
||||
@ExcelProperty(value = "模型描述")
|
||||
private String modelDescribe;
|
||||
|
||||
/**
|
||||
* 模型价格
|
||||
*/
|
||||
@ExcelProperty(value = "模型价格")
|
||||
private Long modelPrice;
|
||||
|
||||
/**
|
||||
* 计费类型
|
||||
*/
|
||||
@ExcelProperty(value = "计费类型")
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
@ExcelProperty(value = "是否显示")
|
||||
private String modelShow;
|
||||
|
||||
/**
|
||||
* 是否免费
|
||||
*/
|
||||
@ExcelProperty(value = "是否免费")
|
||||
private String modelFree;
|
||||
|
||||
/**
|
||||
* 模型优先级(值越大优先级越高)
|
||||
*/
|
||||
@ExcelProperty(value = "模型优先级(值越大优先级越高)")
|
||||
private Long priority;
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
@ExcelProperty(value = "请求地址")
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
@ExcelProperty(value = "密钥")
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 模型维度
|
||||
*/
|
||||
private Integer dimension;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.ruoyi.domain.vo.chat;
|
||||
|
||||
import org.ruoyi.domain.entity.chat.ChatProvider;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 厂商管理视图对象 chat_provider
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ChatProvider.class)
|
||||
public class ChatProviderVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 厂商名称
|
||||
*/
|
||||
@ExcelProperty(value = "厂商名称")
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 厂商编码
|
||||
*/
|
||||
@ExcelProperty(value = "厂商编码")
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
* 厂商图标
|
||||
*/
|
||||
@ExcelProperty(value = "厂商图标")
|
||||
private String providerIcon;
|
||||
|
||||
/**
|
||||
* 厂商描述
|
||||
*/
|
||||
@ExcelProperty(value = "厂商描述")
|
||||
private String providerDesc;
|
||||
|
||||
/**
|
||||
* API地址
|
||||
*/
|
||||
@ExcelProperty(value = "API地址")
|
||||
private String apiHost;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@ExcelProperty(value = "更新IP")
|
||||
private String updateIp;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.ruoyi.domain.vo.chat;
|
||||
|
||||
import org.ruoyi.domain.entity.chat.ChatSession;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 会话管理视图对象 chat_session
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ChatSession.class)
|
||||
public class ChatSessionVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 会话标题
|
||||
*/
|
||||
@ExcelProperty(value = "会话标题")
|
||||
private String sessionTitle;
|
||||
|
||||
/**
|
||||
* 会话内容
|
||||
*/
|
||||
@ExcelProperty(value = "会话内容")
|
||||
private String sessionContent;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
@ExcelProperty(value = "会话ID")
|
||||
private String conversationId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.ruoyi.domain.vo.knowledge;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeAttach;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 知识库附件视图对象 knowledge_attach
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = KnowledgeAttach.class)
|
||||
public class KnowledgeAttachVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 知识库ID
|
||||
*/
|
||||
@ExcelProperty(value = "知识库ID")
|
||||
private Long knowledgeId;
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
@ExcelProperty(value = "文档ID")
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
@ExcelProperty(value = "附件名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 附件类型
|
||||
*/
|
||||
@ExcelProperty(value = "附件类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 对象存储ID
|
||||
*/
|
||||
@ExcelProperty(value = "对象存储ID")
|
||||
private Long ossId;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.ruoyi.domain.vo.knowledge;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeFragment;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 知识片段视图对象 knowledge_fragment
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = KnowledgeFragment.class)
|
||||
public class KnowledgeFragmentVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档ID-用于关联文本块信息
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/**
|
||||
* 片段索引下标
|
||||
*/
|
||||
@ExcelProperty(value = "片段索引下标")
|
||||
private Long idx;
|
||||
|
||||
/**
|
||||
* 文档内容
|
||||
*/
|
||||
@ExcelProperty(value = "文档内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.ruoyi.domain.vo.knowledge;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeGraphInstance;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 知识图谱实例视图对象 knowledge_graph_instance
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = KnowledgeGraphInstance.class)
|
||||
public class KnowledgeGraphInstanceVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 图谱UUID
|
||||
*/
|
||||
@ExcelProperty(value = "图谱UUID")
|
||||
private String graphUuid;
|
||||
|
||||
/**
|
||||
* 关联knowledge_info.kid
|
||||
*/
|
||||
@ExcelProperty(value = "关联knowledge_info.kid")
|
||||
private String knowledgeId;
|
||||
|
||||
/**
|
||||
* 图谱名称
|
||||
*/
|
||||
@ExcelProperty(value = "图谱名称")
|
||||
private String graphName;
|
||||
|
||||
/**
|
||||
* 构建状态:10构建中、20已完成、30失败
|
||||
*/
|
||||
@ExcelProperty(value = "构建状态:10构建中、20已完成、30失败")
|
||||
private Long graphStatus;
|
||||
|
||||
/**
|
||||
* 节点数量
|
||||
*/
|
||||
@ExcelProperty(value = "节点数量")
|
||||
private Long nodeCount;
|
||||
|
||||
/**
|
||||
* 关系数量
|
||||
*/
|
||||
@ExcelProperty(value = "关系数量")
|
||||
private Long relationshipCount;
|
||||
|
||||
/**
|
||||
* 图谱配置(JSON格式)
|
||||
*/
|
||||
@ExcelProperty(value = "图谱配置(JSON格式)")
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* LLM模型名称
|
||||
*/
|
||||
@ExcelProperty(value = "LLM模型名称")
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 实体类型(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "实体类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String entityTypes;
|
||||
|
||||
/**
|
||||
* 关系类型(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "关系类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String relationTypes;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
@ExcelProperty(value = "错误信息")
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package org.ruoyi.domain.vo.knowledge;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeGraphSegment;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 知识图谱片段视图对象 knowledge_graph_segment
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = KnowledgeGraphSegment.class)
|
||||
public class KnowledgeGraphSegmentVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 片段UUID
|
||||
*/
|
||||
@ExcelProperty(value = "片段UUID")
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 知识库UUID
|
||||
*/
|
||||
@ExcelProperty(value = "知识库UUID")
|
||||
private String kbUuid;
|
||||
|
||||
/**
|
||||
* 知识库条目UUID
|
||||
*/
|
||||
@ExcelProperty(value = "知识库条目UUID")
|
||||
private String kbItemUuid;
|
||||
|
||||
/**
|
||||
* 文档UUID
|
||||
*/
|
||||
@ExcelProperty(value = "文档UUID")
|
||||
private String docUuid;
|
||||
|
||||
/**
|
||||
* 片段文本内容
|
||||
*/
|
||||
@ExcelProperty(value = "片段文本内容")
|
||||
private String segmentText;
|
||||
|
||||
/**
|
||||
* 片段索引(第几个片段)
|
||||
*/
|
||||
@ExcelProperty(value = "片段索引", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "第=几个片段")
|
||||
private Long chunkIndex;
|
||||
|
||||
/**
|
||||
* 总片段数
|
||||
*/
|
||||
@ExcelProperty(value = "总片段数")
|
||||
private Long totalChunks;
|
||||
|
||||
/**
|
||||
* 抽取状态:0-待处理 1-处理中 2-已完成 3-失败
|
||||
*/
|
||||
@ExcelProperty(value = "抽取状态:0-待处理 1-处理中 2-已完成 3-失败")
|
||||
private Long extractionStatus;
|
||||
|
||||
/**
|
||||
* 抽取的实体数量
|
||||
*/
|
||||
@ExcelProperty(value = "抽取的实体数量")
|
||||
private Long entityCount;
|
||||
|
||||
/**
|
||||
* 抽取的关系数量
|
||||
*/
|
||||
@ExcelProperty(value = "抽取的关系数量")
|
||||
private Long relationCount;
|
||||
|
||||
/**
|
||||
* 消耗的token数
|
||||
*/
|
||||
@ExcelProperty(value = "消耗的token数")
|
||||
private Long tokenUsed;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
@ExcelProperty(value = "错误信息")
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package org.ruoyi.domain.vo.knowledge;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.entity.knowledge.KnowledgeInfo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 知识库视图对象 knowledge_info
|
||||
*
|
||||
* @author ageerle
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = KnowledgeInfo.class)
|
||||
public class KnowledgeInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 知识库名称
|
||||
*/
|
||||
@ExcelProperty(value = "知识库名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否公开知识库(0 否 1是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否公开知识库", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=,否=,1=是")
|
||||
private Long share;
|
||||
|
||||
/**
|
||||
* 知识库描述
|
||||
*/
|
||||
@ExcelProperty(value = "知识库描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 知识分隔符
|
||||
*/
|
||||
@ExcelProperty(value = "知识分隔符")
|
||||
private String separator;
|
||||
|
||||
/**
|
||||
* 重叠字符数
|
||||
*/
|
||||
@ExcelProperty(value = "重叠字符数")
|
||||
private Long overlapChar;
|
||||
|
||||
/**
|
||||
* 知识库中检索的条数
|
||||
*/
|
||||
@ExcelProperty(value = "知识库中检索的条数")
|
||||
private Integer retrieveLimit;
|
||||
|
||||
/**
|
||||
* 文本块大小
|
||||
*/
|
||||
@ExcelProperty(value = "文本块大小")
|
||||
private Long textBlockSize;
|
||||
|
||||
/**
|
||||
* 向量库
|
||||
*/
|
||||
@ExcelProperty(value = "向量库")
|
||||
private String vectorModel;
|
||||
|
||||
/**
|
||||
* 向量模型
|
||||
*/
|
||||
@ExcelProperty(value = "向量模型")
|
||||
private String embeddingModel;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user