Jelajahi Sumber

新增 agent_plan_step表

alibct 2 bulan lalu
induk
melakukan
73647a0877

+ 12 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentPlanStepMapper.java

@@ -0,0 +1,12 @@
+package com.pavis.admin.aigc.mapper;
+
+import top.continew.starter.data.mp.base.BaseMapper;
+import com.pavis.admin.aigc.model.entity.AgentPlanStepDO;
+
+/**
+* 智能体规划步骤记录 Mapper
+*
+* @author semi
+* @since 2025/05/29 12:50
+*/
+public interface AgentPlanStepMapper extends BaseMapper<AgentPlanStepDO> {}

+ 74 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentPlanStepDO.java

@@ -0,0 +1,74 @@
+package com.pavis.admin.aigc.model.entity;
+
+import lombok.Data;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.pavis.admin.common.model.entity.BaseDO;
+
+
+import java.io.Serial;
+
+/**
+ * 智能体规划步骤记录实体
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Data
+@TableName("aigc_agent_plan_step")
+public class AgentPlanStepDO extends BaseDO {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划ID
+     */
+    private Long planId;
+
+    /**
+     * 所属会话ID
+     */
+    private Long conversationId;
+
+    /**
+     * 对话消息Id
+     */
+    private Long messageId;
+
+    /**
+     * 对话消息内容
+     */
+    private String messageContent;
+
+    /**
+     * 计划主题,大模型根据用户消息生成
+     */
+    private String title;
+
+    /**
+     * 计划描述:[BROWSER_AGENT] 打开百度主页
+     */
+    private String description;
+
+    /**
+     * 步骤序号
+     */
+    private Integer order;
+
+    /**
+     * 本次计划关联的智能体ID
+     */
+    private Long agentId;
+
+    /**
+     * 本次计划要使用的智能体:[BROWSER_AGENT]
+     */
+    private String agentCode;
+
+    /**
+     * 步骤结果
+     */
+    private String result;
+}

+ 102 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AgentPlanStepQuery.java

@@ -0,0 +1,102 @@
+package com.pavis.admin.aigc.model.query;
+
+import lombok.Data;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import top.continew.starter.data.core.annotation.Query;
+import top.continew.starter.data.core.enums.QueryType;
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.*;
+
+/**
+ * 智能体规划步骤记录查询条件
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Data
+@Schema(description = "智能体规划步骤记录查询条件")
+public class AgentPlanStepQuery implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划ID
+     */
+    @Schema(description = "计划ID")
+    @Query(type = QueryType.EQ)
+    private Long planId;
+
+    /**
+     * 所属会话ID
+     */
+    @Schema(description = "所属会话ID")
+    @Query(type = QueryType.EQ)
+    private Long conversationId;
+
+    /**
+     * 对话消息Id
+     */
+    @Schema(description = "对话消息Id")
+    @Query(type = QueryType.EQ)
+    private Long messageId;
+
+    /**
+     * 对话消息内容
+     */
+    @Schema(description = "对话消息内容")
+    @Query(type = QueryType.EQ)
+    private String messageContent;
+
+    /**
+     * 计划主题,大模型根据用户消息生成
+     */
+    @Schema(description = "计划主题,大模型根据用户消息生成")
+    @Query(type = QueryType.EQ)
+    private String title;
+
+    /**
+     * 计划描述:[BROWSER_AGENT] 打开百度主页
+     */
+    @Schema(description = "计划描述:[BROWSER_AGENT] 打开百度主页")
+    @Query(type = QueryType.EQ)
+    private String description;
+
+    /**
+     * 本次计划关联的智能体ID
+     */
+    @Schema(description = "本次计划关联的智能体ID")
+    @Query(type = QueryType.EQ)
+    private Long agentId;
+
+    /**
+     * 本次计划要使用的智能体:[BROWSER_AGENT]
+     */
+    @Schema(description = "本次计划要使用的智能体:[BROWSER_AGENT]")
+    @Query(type = QueryType.EQ)
+    private String agentCode;
+
+    /**
+     * 步骤结果
+     */
+    @Schema(description = "步骤结果")
+    @Query(type = QueryType.EQ)
+    private String result;
+
+    /**
+     * 创建人
+     */
+    @Schema(description = "创建人")
+    @Query(type = QueryType.EQ)
+    private Long createUser;
+
+    /**
+     * 创建时间
+     */
+    @Schema(description = "创建时间")
+    @Query(type = QueryType.EQ)
+    private LocalDateTime createTime;
+}

+ 108 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AgentPlanStepReq.java

@@ -0,0 +1,108 @@
+package com.pavis.admin.aigc.model.req;
+
+import jakarta.validation.constraints.*;
+
+import lombok.Data;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import org.hibernate.validator.constraints.Length;
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.*;
+
+/**
+ * 智能体规划步骤记录创建或修改参数
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Data
+@Schema(description = "智能体规划步骤记录创建或修改参数")
+public class AgentPlanStepReq implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划ID
+     */
+    @Schema(description = "计划ID")
+    @NotNull(message = "计划ID不能为空")
+    private Long planId;
+
+    /**
+     * 所属会话ID
+     */
+    @Schema(description = "所属会话ID")
+    @NotNull(message = "所属会话ID不能为空")
+    private Long conversationId;
+
+    /**
+     * 对话消息Id
+     */
+    @Schema(description = "对话消息Id")
+    @NotNull(message = "对话消息Id不能为空")
+    private Long messageId;
+
+    /**
+     * 对话消息内容
+     */
+    @Schema(description = "对话消息内容")
+    @NotBlank(message = "对话消息内容不能为空")
+    @Length(max = 2147483647, message = "对话消息内容长度不能超过 {max} 个字符")
+    private String messageContent;
+
+    /**
+     * 计划主题,大模型根据用户消息生成
+     */
+    @Schema(description = "计划主题,大模型根据用户消息生成")
+    @NotBlank(message = "计划主题,大模型根据用户消息生成不能为空")
+    @Length(max = 500, message = "计划主题,大模型根据用户消息生成长度不能超过 {max} 个字符")
+    private String title;
+
+    /**
+     * 计划描述:[BROWSER_AGENT] 打开百度主页
+     */
+    @Schema(description = "计划描述:[BROWSER_AGENT] 打开百度主页")
+    @NotBlank(message = "计划描述:[BROWSER_AGENT] 打开百度主页不能为空")
+    @Length(max = 500, message = "计划描述:[BROWSER_AGENT] 打开百度主页长度不能超过 {max} 个字符")
+    private String description;
+
+    /**
+     * 本次计划关联的智能体ID
+     */
+    @Schema(description = "本次计划关联的智能体ID")
+    @NotNull(message = "本次计划关联的智能体ID不能为空")
+    private Long agentId;
+
+    /**
+     * 本次计划要使用的智能体:[BROWSER_AGENT]
+     */
+    @Schema(description = "本次计划要使用的智能体:[BROWSER_AGENT]")
+    @NotBlank(message = "本次计划要使用的智能体:[BROWSER_AGENT]不能为空")
+    @Length(max = 50, message = "本次计划要使用的智能体:[BROWSER_AGENT]长度不能超过 {max} 个字符")
+    private String agentCode;
+
+    /**
+     * 步骤结果
+     */
+    @Schema(description = "步骤结果")
+    @NotBlank(message = "步骤结果不能为空")
+    @Length(max = 65535, message = "步骤结果长度不能超过 {max} 个字符")
+    private String result;
+
+    /**
+     * 创建人
+     */
+    @Schema(description = "创建人")
+    @NotNull(message = "创建人不能为空")
+    private Long createUser;
+
+    /**
+     * 创建时间
+     */
+    @Schema(description = "创建时间")
+    @NotNull(message = "创建时间不能为空")
+    private LocalDateTime createTime;
+}

+ 97 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepDetailResp.java

@@ -0,0 +1,97 @@
+package com.pavis.admin.aigc.model.resp;
+
+import lombok.Data;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+import com.pavis.admin.common.model.resp.BaseDetailResp;
+import java.io.Serial;
+import java.time.*;
+
+/**
+ * 智能体规划步骤记录详情信息
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Data
+@ExcelIgnoreUnannotated
+@Schema(description = "智能体规划步骤记录详情信息")
+public class AgentPlanStepDetailResp extends BaseDetailResp {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划ID
+     */
+    @Schema(description = "计划ID")
+    @ExcelProperty(value = "计划ID")
+    private Long planId;
+
+    /**
+     * 所属会话ID
+     */
+    @Schema(description = "所属会话ID")
+    @ExcelProperty(value = "所属会话ID")
+    private Long conversationId;
+
+    /**
+     * 对话消息Id
+     */
+    @Schema(description = "对话消息Id")
+    @ExcelProperty(value = "对话消息Id")
+    private Long messageId;
+
+    /**
+     * 对话消息内容
+     */
+    @Schema(description = "对话消息内容")
+    @ExcelProperty(value = "对话消息内容")
+    private String messageContent;
+
+    /**
+     * 计划主题,大模型根据用户消息生成
+     */
+    @Schema(description = "计划主题,大模型根据用户消息生成")
+    @ExcelProperty(value = "计划主题,大模型根据用户消息生成")
+    private String title;
+
+    /**
+     * 计划描述:[BROWSER_AGENT] 打开百度主页
+     */
+    @Schema(description = "计划描述:[BROWSER_AGENT] 打开百度主页")
+    @ExcelProperty(value = "计划描述:[BROWSER_AGENT] 打开百度主页")
+    private String description;
+
+    /**
+     * 步骤序号
+     */
+    @Schema(description = "步骤序号")
+    @ExcelProperty(value = "步骤序号")
+    private Integer order;
+
+    /**
+     * 本次计划关联的智能体ID
+     */
+    @Schema(description = "本次计划关联的智能体ID")
+    @ExcelProperty(value = "本次计划关联的智能体ID")
+    private Long agentId;
+
+    /**
+     * 本次计划要使用的智能体:[BROWSER_AGENT]
+     */
+    @Schema(description = "本次计划要使用的智能体:[BROWSER_AGENT]")
+    @ExcelProperty(value = "本次计划要使用的智能体:[BROWSER_AGENT]")
+    private String agentCode;
+
+    /**
+     * 步骤结果
+     */
+    @Schema(description = "步骤结果")
+    @ExcelProperty(value = "步骤结果")
+    private String result;
+}

+ 95 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepResp.java

@@ -0,0 +1,95 @@
+package com.pavis.admin.aigc.model.resp;
+
+import lombok.Data;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import com.pavis.admin.common.model.resp.BaseResp;
+import java.io.Serial;
+import java.time.*;
+
+/**
+ * 智能体规划步骤记录信息
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Data
+@Schema(description = "智能体规划步骤记录信息")
+public class AgentPlanStepResp extends BaseResp {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划ID
+     */
+    @Schema(description = "计划ID")
+    private Long planId;
+
+    /**
+     * 所属会话ID
+     */
+    @Schema(description = "所属会话ID")
+    private Long conversationId;
+
+    /**
+     * 对话消息Id
+     */
+    @Schema(description = "对话消息Id")
+    private Long messageId;
+
+    /**
+     * 对话消息内容
+     */
+    @Schema(description = "对话消息内容")
+    private String messageContent;
+
+    /**
+     * 计划主题,大模型根据用户消息生成
+     */
+    @Schema(description = "计划主题,大模型根据用户消息生成")
+    private String title;
+
+    /**
+     * 计划描述:[BROWSER_AGENT] 打开百度主页
+     */
+    @Schema(description = "计划描述:[BROWSER_AGENT] 打开百度主页")
+    private String description;
+
+    /**
+     * 步骤序号
+     */
+    @Schema(description = "步骤序号")
+    private Integer order;
+
+    /**
+     * 本次计划关联的智能体ID
+     */
+    @Schema(description = "本次计划关联的智能体ID")
+    private Long agentId;
+
+    /**
+     * 本次计划要使用的智能体:[BROWSER_AGENT]
+     */
+    @Schema(description = "本次计划要使用的智能体:[BROWSER_AGENT]")
+    private String agentCode;
+
+    /**
+     * 步骤结果
+     */
+    @Schema(description = "步骤结果")
+    private String result;
+
+    /**
+     * 修改人
+     */
+    @Schema(description = "修改人")
+    private Long updateUser;
+
+    /**
+     * 修改时间
+     */
+    @Schema(description = "修改时间")
+    private LocalDateTime updateTime;
+}

+ 15 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/service/AgentPlanStepService.java

@@ -0,0 +1,15 @@
+package com.pavis.admin.aigc.service;
+
+import top.continew.starter.extension.crud.service.BaseService;
+import com.pavis.admin.aigc.model.query.AgentPlanStepQuery;
+import com.pavis.admin.aigc.model.req.AgentPlanStepReq;
+import com.pavis.admin.aigc.model.resp.AgentPlanStepDetailResp;
+import com.pavis.admin.aigc.model.resp.AgentPlanStepResp;
+
+/**
+ * 智能体规划步骤记录业务接口
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+public interface AgentPlanStepService extends BaseService<AgentPlanStepResp, AgentPlanStepDetailResp, AgentPlanStepQuery, AgentPlanStepReq> {}

+ 24 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/service/impl/AgentPlanStepServiceImpl.java

@@ -0,0 +1,24 @@
+package com.pavis.admin.aigc.service.impl;
+
+import lombok.RequiredArgsConstructor;
+
+import org.springframework.stereotype.Service;
+
+import top.continew.starter.extension.crud.service.BaseServiceImpl;
+import com.pavis.admin.aigc.mapper.AgentPlanStepMapper;
+import com.pavis.admin.aigc.model.entity.AgentPlanStepDO;
+import com.pavis.admin.aigc.model.query.AgentPlanStepQuery;
+import com.pavis.admin.aigc.model.req.AgentPlanStepReq;
+import com.pavis.admin.aigc.model.resp.AgentPlanStepDetailResp;
+import com.pavis.admin.aigc.model.resp.AgentPlanStepResp;
+import com.pavis.admin.aigc.service.AgentPlanStepService;
+
+/**
+ * 智能体规划步骤记录业务实现
+ *
+ * @author semi
+ * @since 2025/05/29 12:50
+ */
+@Service
+@RequiredArgsConstructor
+public class AgentPlanStepServiceImpl extends BaseServiceImpl<AgentPlanStepMapper, AgentPlanStepDO, AgentPlanStepResp, AgentPlanStepDetailResp, AgentPlanStepQuery, AgentPlanStepReq> implements AgentPlanStepService {}

+ 4 - 0
pavis-module-aigc/src/main/resources/AgentPlanStepMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.pavis.admin.aigc.mapper.AgentPlanStepMapper">
+</mapper>

+ 27 - 0
pavis-webapi/src/main/resources/db/changelog/mysql/main_table.sql

@@ -915,6 +915,33 @@ CREATE TABLE IF NOT EXISTS `aigc_agent_plan`
 ) ENGINE = InnoDB
   DEFAULT CHARSET = utf8mb4 COMMENT ='智能体规划记录表';
 
+-- ------------------------------
+-- Table structure for aigc_agent_plan_step
+-- ------------------------------
+CREATE TABLE IF NOT EXISTS `aigc_agent_plan_step`
+(
+    `id`              BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
+    `plan_id`         BIGINT UNSIGNED NOT NULL COMMENT '计划ID',
+    `conversation_id` BIGINT UNSIGNED NOT NULL COMMENT '所属会话ID',
+    `message_id`      BIGINT UNSIGNED NOT NULL COMMENT '对话消息Id',
+    `message_content` LONGTEXT        NOT NULL COMMENT '对话消息内容',
+    `title`           VARCHAR(500)    NOT NULL COMMENT '计划主题,大模型根据用户消息生成',
+    `description`     VARCHAR(500)    NOT NULL COMMENT '计划描述:[BROWSER_AGENT] 打开百度主页',
+    `order`           INT      DEFAULT NULL COMMENT '步骤序号',
+    `agent_id`        BIGINT UNSIGNED NOT NULL COMMENT '本次计划关联的智能体ID',
+    `agent_code`      VARCHAR(50)     NOT NULL COMMENT '本次计划要使用的智能体:[BROWSER_AGENT]',
+    `result`          TEXT            NOT NULL COMMENT '步骤结果',
+    `create_user`     BIGINT          NOT NULL COMMENT '创建人',
+    `create_time`     DATETIME        NOT NULL COMMENT '创建时间',
+    `update_user`     BIGINT   DEFAULT NULL COMMENT '修改人',
+    `update_time`     DATETIME DEFAULT NULL COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    KEY `idx_message_id` (`message_id`),
+    KEY `idx_conversation_id` (`conversation_id`),
+    KEY `idx_plan_id` (`plan_id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='智能体规划步骤记录表';
+
 -- ------------------------------
 -- Table structure for aigc_agent_execution
 -- ------------------------------