From 189821dc59b94ef280f4a69501892b9193c6adef Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 15 May 2025 22:29:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4AI=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81=E5=B9=B6=E6=96=B0=E5=A2=9E=E5=AE=98?= =?UTF-8?q?=E7=BD=91=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除与AI相关的接口、服务、实体类及Mapper文件,新增官网模块的相关实体类、控制器和服务接口。此次重构旨在清理不再使用的AI代码,并为官网模块提供基础支持。 --- .../dromara/ai/constant/AiMessageRoleConstant.java | 13 -- .../dromara/ai/constant/AiModelTypeConstant.java | 5 - .../ai/controller/AiAgentChatController.java | 105 ------------- .../controller/AiAgentChatHistoryController.java | 105 ------------- .../dromara/ai/controller/AiAgentController.java | 105 ------------- .../org/dromara/ai/controller/ChatController.java | 69 --------- .../java/org/dromara/ai/domain/bo/AiAgentBo.java | 53 ------- .../org/dromara/ai/domain/bo/AiAgentChatBo.java | 56 ------- .../dromara/ai/domain/bo/AiAgentChatHistoryBo.java | 60 -------- .../org/dromara/ai/domain/bo/AiChatMessageBo.java | 32 ---- .../dromara/ai/domain/vo/AiAgentChatHistoryVo.java | 69 --------- .../org/dromara/ai/domain/vo/AiAgentChatVo.java | 74 --------- .../ai/mapper/AiAgentChatHistoryMapper.java | 15 -- .../org/dromara/ai/mapper/AiAgentChatMapper.java | 15 -- .../java/org/dromara/ai/mapper/AiAgentMapper.java | 15 -- .../ai/service/IAiAgentChatHistoryService.java | 76 ---------- .../dromara/ai/service/IAiAgentChatService.java | 68 --------- .../org/dromara/ai/service/IAiAgentService.java | 68 --------- .../java/org/dromara/ai/service/IChatService.java | 34 ----- .../org/dromara/ai/service/IChatServiceNew.java | 4 - .../impl/AiAgentChatHistoryServiceImpl.java | 148 ------------------ .../ai/service/impl/AiAgentChatServiceImpl.java | 168 --------------------- .../ai/service/impl/AiAgentServiceImpl.java | 131 ---------------- .../dromara/ai/service/impl/ChatServiceImpl.java | 145 ------------------ .../ai/service/impl/IChatServiceNewImpl.java | 10 -- .../dromara/officialWebsite/domain/OwCases.java | 93 ++++++++++++ .../domain/OwDevelopmentHistory.java} | 27 ++-- .../domain/OwLeaveMessage.java} | 27 ++-- .../domain/OwServiceProcess.java} | 32 ++-- .../domain/vo/OwLeaveMessageVo.java} | 37 ++--- .../controller/OwFrontCaseCategoryController.java | 34 +++++ .../front/controller/OwFrontCasesController.java | 105 +++++++++++++ .../controller/OwFrontConfigParamsController.java | 49 ++++++ .../OwFrontDevelopmentHistoryController.java | 105 +++++++++++++ .../controller/OwFrontLeaveMessageController.java | 105 +++++++++++++ .../OwFrontServiceProcessController.java | 105 +++++++++++++ .../mapper/ai/AiAgentChatHistoryMapper.xml | 7 - .../main/resources/mapper/ai/AiAgentChatMapper.xml | 7 - .../src/main/resources/mapper/ai/AiAgentMapper.xml | 7 - .../mapper/project/PmAmountRecordMapper.xml | 7 - .../resources/mapper/project/PmProjectMapper.xml | 7 - .../mapper/project/PmProjectMemberMapper.xml | 7 - 42 files changed, 650 insertions(+), 1754 deletions(-) delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiMessageRoleConstant.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiModelTypeConstant.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatController.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatHistoryController.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentController.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/ChatController.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentBo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatBo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatHistoryBo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiChatMessageBo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatHistoryVo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatVo.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatHistoryMapper.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatMapper.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentMapper.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatHistoryService.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatService.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentService.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatService.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatServiceNew.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatHistoryServiceImpl.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatServiceImpl.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentServiceImpl.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/ChatServiceImpl.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/IChatServiceNewImpl.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwCases.java rename java-api/ruoyi-modules/h-project/src/main/java/org/dromara/{ai/domain/AiAgent.java => officialWebsite/domain/OwDevelopmentHistory.java} (63%) rename java-api/ruoyi-modules/h-project/src/main/java/org/dromara/{ai/domain/AiAgentChat.java => officialWebsite/domain/OwLeaveMessage.java} (61%) rename java-api/ruoyi-modules/h-project/src/main/java/org/dromara/{ai/domain/AiAgentChatHistory.java => officialWebsite/domain/OwServiceProcess.java} (51%) rename java-api/ruoyi-modules/h-project/src/main/java/org/dromara/{ai/domain/vo/AiAgentVo.java => officialWebsite/domain/vo/OwLeaveMessageVo.java} (50%) create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCaseCategoryController.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCasesController.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontConfigParamsController.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontDevelopmentHistoryController.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontLeaveMessageController.java create mode 100644 java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontServiceProcessController.java delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatHistoryMapper.xml delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatMapper.xml delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentMapper.xml delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmAmountRecordMapper.xml delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMapper.xml delete mode 100644 java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMemberMapper.xml diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiMessageRoleConstant.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiMessageRoleConstant.java deleted file mode 100644 index 5e6a1eb..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiMessageRoleConstant.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.dromara.ai.constant; - -public interface AiMessageRoleConstant { - - // 系统 - static final String SYSTEM = "system"; - - // 用户 - static final String USER = "user"; - - // 智能体 - static final String ASSISTANT = "assistant"; -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiModelTypeConstant.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiModelTypeConstant.java deleted file mode 100644 index 3eed202..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/constant/AiModelTypeConstant.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.dromara.ai.constant; - -public interface AiModelTypeConstant { - String OPENAI = "openai"; -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatController.java deleted file mode 100644 index 2acecc4..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatController.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.dromara.ai.controller; - -import java.util.List; - -import lombok.RequiredArgsConstructor; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.*; -import cn.dev33.satoken.annotation.SaCheckPermission; -import org.springframework.web.bind.annotation.*; -import org.springframework.validation.annotation.Validated; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.web.core.BaseController; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.log.enums.BusinessType; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.ai.service.IAiAgentChatService; -import org.dromara.common.mybatis.core.page.TableDataInfo; - -/** - * 智能体的对话 - * - * @author Lion Li - * @date 2024-11-07 - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/ai/agentChat") -public class AiAgentChatController extends BaseController { - - private final IAiAgentChatService aiAgentChatService; - - /** - * 查询智能体的对话列表 - */ - @SaCheckPermission("ai:agentChat:list") - @GetMapping("/list") - public TableDataInfo list(AiAgentChatBo bo, PageQuery pageQuery) { - return aiAgentChatService.queryPageList(bo, pageQuery); - } - - /** - * 导出智能体的对话列表 - */ - @SaCheckPermission("ai:agentChat:export") - @Log(title = "智能体的对话", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(AiAgentChatBo bo, HttpServletResponse response) { - List list = aiAgentChatService.queryList(bo); - ExcelUtil.exportExcel(list, "智能体的对话", AiAgentChatVo.class, response); - } - - /** - * 获取智能体的对话详细信息 - * - * @param id 主键 - */ - @SaCheckPermission("ai:agentChat:query") - @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long id) { - return R.ok(aiAgentChatService.queryById(id)); - } - - /** - * 新增智能体的对话 - */ - @SaCheckPermission("ai:agentChat:add") - @Log(title = "智能体的对话", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody AiAgentChatBo bo) { - return toAjax(aiAgentChatService.insertByBo(bo)); - } - - /** - * 修改智能体的对话 - */ - @SaCheckPermission("ai:agentChat:edit") - @Log(title = "智能体的对话", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody AiAgentChatBo bo) { - return toAjax(aiAgentChatService.updateByBo(bo)); - } - - /** - * 删除智能体的对话 - * - * @param ids 主键串 - */ - @SaCheckPermission("ai:agentChat:remove") - @Log(title = "智能体的对话", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(aiAgentChatService.deleteWithValidByIds(List.of(ids), true)); - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatHistoryController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatHistoryController.java deleted file mode 100644 index e37c05d..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentChatHistoryController.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.dromara.ai.controller; - -import java.util.List; - -import lombok.RequiredArgsConstructor; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.*; -import cn.dev33.satoken.annotation.SaCheckPermission; -import org.springframework.web.bind.annotation.*; -import org.springframework.validation.annotation.Validated; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.web.core.BaseController; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.log.enums.BusinessType; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.bo.AiAgentChatHistoryBo; -import org.dromara.ai.service.IAiAgentChatHistoryService; -import org.dromara.common.mybatis.core.page.TableDataInfo; - -/** - * 聊天记录 - * - * @author Lion Li - * @date 2024-11-07 - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/ai/agentChatHistory") -public class AiAgentChatHistoryController extends BaseController { - - private final IAiAgentChatHistoryService aiAgentChatHistoryService; - - /** - * 查询聊天记录列表 - */ - @SaCheckPermission("ai:agentChatHistory:list") - @GetMapping("/list") - public TableDataInfo list(AiAgentChatHistoryBo bo, PageQuery pageQuery) { - return aiAgentChatHistoryService.queryPageList(bo, pageQuery); - } - - /** - * 导出聊天记录列表 - */ - @SaCheckPermission("ai:agentChatHistory:export") - @Log(title = "聊天记录", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(AiAgentChatHistoryBo bo, HttpServletResponse response) { - List list = aiAgentChatHistoryService.queryList(bo); - ExcelUtil.exportExcel(list, "聊天记录", AiAgentChatHistoryVo.class, response); - } - - /** - * 获取聊天记录详细信息 - * - * @param id 主键 - */ - @SaCheckPermission("ai:agentChatHistory:query") - @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long id) { - return R.ok(aiAgentChatHistoryService.queryById(id)); - } - - /** - * 新增聊天记录 - */ - @SaCheckPermission("ai:agentChatHistory:add") - @Log(title = "聊天记录", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody AiAgentChatHistoryBo bo) { - return toAjax(aiAgentChatHistoryService.insertByBo(bo)); - } - - /** - * 修改聊天记录 - */ - @SaCheckPermission("ai:agentChatHistory:edit") - @Log(title = "聊天记录", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody AiAgentChatHistoryBo bo) { - return toAjax(aiAgentChatHistoryService.updateByBo(bo)); - } - - /** - * 删除聊天记录 - * - * @param ids 主键串 - */ - @SaCheckPermission("ai:agentChatHistory:remove") - @Log(title = "聊天记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(aiAgentChatHistoryService.deleteWithValidByIds(List.of(ids), true)); - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentController.java deleted file mode 100644 index 55ff883..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/AiAgentController.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.dromara.ai.controller; - -import java.util.List; - -import lombok.RequiredArgsConstructor; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.*; -import cn.dev33.satoken.annotation.SaCheckPermission; -import org.springframework.web.bind.annotation.*; -import org.springframework.validation.annotation.Validated; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.web.core.BaseController; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import org.dromara.common.log.enums.BusinessType; -import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.ai.domain.vo.AiAgentVo; -import org.dromara.ai.domain.bo.AiAgentBo; -import org.dromara.ai.service.IAiAgentService; -import org.dromara.common.mybatis.core.page.TableDataInfo; - -/** - * 智能体 - * - * @author Lion Li - * @date 2024-11-07 - */ -@Validated -@RequiredArgsConstructor -@RestController -@RequestMapping("/ai/agent") -public class AiAgentController extends BaseController { - - private final IAiAgentService aiAgentService; - - /** - * 查询智能体列表 - */ - @SaCheckPermission("ai:agent:list") - @GetMapping("/list") - public TableDataInfo list(AiAgentBo bo, PageQuery pageQuery) { - return aiAgentService.queryPageList(bo, pageQuery); - } - - /** - * 导出智能体列表 - */ - @SaCheckPermission("ai:agent:export") - @Log(title = "智能体", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(AiAgentBo bo, HttpServletResponse response) { - List list = aiAgentService.queryList(bo); - ExcelUtil.exportExcel(list, "智能体", AiAgentVo.class, response); - } - - /** - * 获取智能体详细信息 - * - * @param id 主键 - */ - @SaCheckPermission("ai:agent:query") - @GetMapping("/{id}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long id) { - return R.ok(aiAgentService.queryById(id)); - } - - /** - * 新增智能体 - */ - @SaCheckPermission("ai:agent:add") - @Log(title = "智能体", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody AiAgentBo bo) { - return toAjax(aiAgentService.insertByBo(bo)); - } - - /** - * 修改智能体 - */ - @SaCheckPermission("ai:agent:edit") - @Log(title = "智能体", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody AiAgentBo bo) { - return toAjax(aiAgentService.updateByBo(bo)); - } - - /** - * 删除智能体 - * - * @param ids 主键串 - */ - @SaCheckPermission("ai:agent:remove") - @Log(title = "智能体", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Long[] ids) { - return toAjax(aiAgentService.deleteWithValidByIds(List.of(ids), true)); - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/ChatController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/ChatController.java deleted file mode 100644 index 7f43a95..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/controller/ChatController.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.dromara.ai.controller; - -import cn.dev33.satoken.annotation.SaIgnore; -import lombok.RequiredArgsConstructor; -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.ai.domain.bo.AiChatMessageBo; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.ai.service.IChatService; -import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import reactor.core.publisher.Flux; - - -/*** - * 聊天接口 - */ -@SaIgnore -@RestController -@RequestMapping("/api/ai/chat") -@RequiredArgsConstructor -public class ChatController { - - private final IChatService chatService; - - /** - * 获取我的对话 - */ - @GetMapping("/listMyChats") - public R> queryPageList(AiAgentChatBo bo, PageQuery pageQuery){ - return R.ok(chatService.listMyChats(bo, pageQuery)); - } - - - /** - * 获取我的聊天记录 - */ - @GetMapping("/getMyChatMessages/{chatId}") - public R> getMyChatMessages(@PathVariable("chatId") Long chatId, PageQuery pageQuery){ - return R.ok(chatService.getMyChatMessages(chatId, pageQuery)); - } - - - /*** - * 聊天,流式数据 - * @param message 用户发给ai的消息 - * @return Flux - */ - @GetMapping(value = "/sendMessageFlux",produces = "text/event-stream;charset=utf-8") - public Flux sendMessageFlux(@Validated(AddGroup.class) AiChatMessageBo message){ - return chatService.sendMessageFlux(message); - } - - /*** - * 聊天 - * @param message 用户发给ai的消息 - * @return R - */ - @GetMapping(value = "/sendMessage") - public R sendMessage(@Validated(AddGroup.class) AiChatMessageBo message){ - return R.ok(chatService.sendMessage(message)); - } - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentBo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentBo.java deleted file mode 100644 index 472b1f2..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentBo.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.dromara.ai.domain.bo; - -import org.dromara.ai.domain.AiAgent; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; -import lombok.EqualsAndHashCode; -import jakarta.validation.constraints.*; - -/** - * 智能体业务对象 ai_agent - * - * @author Lion Li - * @date 2024-11-07 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = AiAgent.class, reverseConvertGenerate = false) -public class AiAgentBo extends BaseEntity { - - /** - * 编号 - */ - @NotNull(message = "编号不能为空", groups = { EditGroup.class }) - private Long id; - - /** - * 智能体名称 - */ - @NotBlank(message = "智能体名称不能为空", groups = { AddGroup.class, EditGroup.class }) - private String name; - - /** - * 状态 - */ - @NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long status; - - /** - * 备注 - */ - private String remark; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long aiSort; - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatBo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatBo.java deleted file mode 100644 index 8836c6f..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatBo.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.dromara.ai.domain.bo; - -import lombok.*; -import org.dromara.ai.domain.AiAgentChat; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.*; - -/** - * 智能体的对话业务对象 ai_agent_chat - * - * @author Lion Li - * @date 2024-11-07 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = AiAgentChat.class, reverseConvertGenerate = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class AiAgentChatBo extends BaseEntity { - - /** - * 编号 - */ - @NotNull(message = "编号不能为空", groups = { EditGroup.class }) - private Long id; - - /** - * 智能体id - */ - @NotNull(message = "智能体id不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long agentId; - - /** - * 用户id - */ - @NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long uid; - - /** - * 对话名称 - */ - @NotBlank(message = "对话名称不能为空", groups = { AddGroup.class, EditGroup.class }) - private String chatName; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long aiSort; - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatHistoryBo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatHistoryBo.java deleted file mode 100644 index 86f3868..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiAgentChatHistoryBo.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.dromara.ai.domain.bo; - -import lombok.*; -import org.dromara.ai.domain.AiAgentChatHistory; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; -import io.github.linpeilie.annotations.AutoMapper; -import jakarta.validation.constraints.*; - -/** - * 聊天记录业务对象 ai_agent_chat_history - * - * @author Lion Li - * @date 2024-11-07 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@AutoMapper(target = AiAgentChatHistory.class, reverseConvertGenerate = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class AiAgentChatHistoryBo extends BaseEntity { - - /** - * 编号 - */ - @NotNull(message = "编号不能为空", groups = { EditGroup.class }) - private Long id; - - /** - * 对话id - */ - private Long agentChatId; - - /** - * 智能体id - */ - private Long agentId; - - /** - * 对话身份 - */ - @NotBlank(message = "对话身份不能为空", groups = { AddGroup.class, EditGroup.class }) - private String role; - - /** - * 对话内容 - */ - @NotBlank(message = "对话内容不能为空", groups = { AddGroup.class, EditGroup.class }) - private String message; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long aiSort; - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiChatMessageBo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiChatMessageBo.java deleted file mode 100644 index 21f3bea..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/bo/AiChatMessageBo.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.dromara.ai.domain.bo; - -import jakarta.validation.constraints.NotNull; -import lombok.*; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class AiChatMessageBo { - - // 模型类型 - private String modelType; - - // 模型 - private String model; - - // 智能体id - @NotNull(message = "智能体id不能为空", groups = AddGroup.class) - private Long agentId; - - // 消息 - @NotNull(message = "消息不能为空", groups = AddGroup.class) - private String message; - - // 对话id - @NotNull(message = "对话id不能为空", groups = AddGroup.class) - private Long chatId; - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatHistoryVo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatHistoryVo.java deleted file mode 100644 index 0d4627a..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatHistoryVo.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.dromara.ai.domain.vo; - -import org.dromara.ai.domain.AiAgentChatHistory; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; -import java.util.Date; - - - -/** - * 聊天记录视图对象 ai_agent_chat_history - * - * @author Lion Li - * @date 2024-11-07 - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = AiAgentChatHistory.class) -public class AiAgentChatHistoryVo implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 编号 - */ - @ExcelProperty(value = "编号") - private Long id; - - /** - * 对话id - */ - @ExcelProperty(value = "对话id") - private Long agentChatId; - - /** - * 智能体id - */ - @ExcelProperty(value = "智能体id") - private Long agentId; - - /** - * 对话身份 - */ - @ExcelProperty(value = "对话身份", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "ai_agent_chat_history_role") - private String role; - - /** - * 对话内容 - */ - @ExcelProperty(value = "对话内容") - private String message; - - /** - * 排序 - */ - @ExcelProperty(value = "排序") - private Long aiSort; - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatVo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatVo.java deleted file mode 100644 index d711ec3..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentChatVo.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.dromara.ai.domain.vo; - -import org.dromara.ai.domain.AiAgentChat; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; -import java.util.Date; - - - -/** - * 智能体的对话视图对象 ai_agent_chat - * - * @author Lion Li - * @date 2024-11-07 - */ -@Data -@ExcelIgnoreUnannotated -@AutoMapper(target = AiAgentChat.class) -public class AiAgentChatVo implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 编号 - */ - @ExcelProperty(value = "编号") - private Long id; - - /** - * 智能体id - */ - @ExcelProperty(value = "智能体id") - private Long agentId; - - /** - * 智能体名称 - */ - @ExcelProperty(value = "智能体名称") - private String agentName; - - /** - * 用户id - */ - @ExcelProperty(value = "用户id") - private Long uid; - - /** - * 用户名称 - */ - @ExcelProperty(value = "用户名称") - private String nickName; - - /** - * 对话名称 - */ - @ExcelProperty(value = "对话名称") - private String chatName; - - /** - * 排序 - */ - @ExcelProperty(value = "排序") - private Long aiSort; - - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatHistoryMapper.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatHistoryMapper.java deleted file mode 100644 index 4d5d6cf..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatHistoryMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.dromara.ai.mapper; - -import org.dromara.ai.domain.AiAgentChatHistory; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; - -/** - * 聊天记录Mapper接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface AiAgentChatHistoryMapper extends BaseMapperPlus { - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatMapper.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatMapper.java deleted file mode 100644 index 865e3b2..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentChatMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.dromara.ai.mapper; - -import org.dromara.ai.domain.AiAgentChat; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; - -/** - * 智能体的对话Mapper接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface AiAgentChatMapper extends BaseMapperPlus { - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentMapper.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentMapper.java deleted file mode 100644 index ebf0cce..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/mapper/AiAgentMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.dromara.ai.mapper; - -import org.dromara.ai.domain.AiAgent; -import org.dromara.ai.domain.vo.AiAgentVo; -import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; - -/** - * 智能体Mapper接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface AiAgentMapper extends BaseMapperPlus { - -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatHistoryService.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatHistoryService.java deleted file mode 100644 index 027fbca..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatHistoryService.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.dromara.ai.service; - -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.bo.AiAgentChatHistoryBo; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; - -import java.util.Collection; -import java.util.List; - -/** - * 聊天记录Service接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface IAiAgentChatHistoryService { - - /** - * 查询聊天记录 - * - * @param id 主键 - * @return 聊天记录 - */ - AiAgentChatHistoryVo queryById(Long id); - - /** - * 分页查询聊天记录列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 聊天记录分页列表 - */ - TableDataInfo queryPageList(AiAgentChatHistoryBo bo, PageQuery pageQuery); - - /** - * 查询符合条件的聊天记录列表 - * - * @param bo 查询条件 - * @return 聊天记录列表 - */ - List queryList(AiAgentChatHistoryBo bo); - - /** - * 根据智能体id查询系统消息列表 - * - * @param agentId 智能体ID - * @return 聊天记录列表 - */ - List querySystemOverallList(Long agentId); - - /** - * 新增聊天记录 - * - * @param bo 聊天记录 - * @return 是否新增成功 - */ - Boolean insertByBo(AiAgentChatHistoryBo bo); - - /** - * 修改聊天记录 - * - * @param bo 聊天记录 - * @return 是否修改成功 - */ - Boolean updateByBo(AiAgentChatHistoryBo bo); - - /** - * 校验并批量删除聊天记录信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatService.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatService.java deleted file mode 100644 index 13d6e05..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentChatService.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.dromara.ai.service; - -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; - -import java.util.Collection; -import java.util.List; - -/** - * 智能体的对话Service接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface IAiAgentChatService { - - /** - * 查询智能体的对话 - * - * @param id 主键 - * @return 智能体的对话 - */ - AiAgentChatVo queryById(Long id); - - /** - * 分页查询智能体的对话列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 智能体的对话分页列表 - */ - TableDataInfo queryPageList(AiAgentChatBo bo, PageQuery pageQuery); - - /** - * 查询符合条件的智能体的对话列表 - * - * @param bo 查询条件 - * @return 智能体的对话列表 - */ - List queryList(AiAgentChatBo bo); - - /** - * 新增智能体的对话 - * - * @param bo 智能体的对话 - * @return 是否新增成功 - */ - Boolean insertByBo(AiAgentChatBo bo); - - /** - * 修改智能体的对话 - * - * @param bo 智能体的对话 - * @return 是否修改成功 - */ - Boolean updateByBo(AiAgentChatBo bo); - - /** - * 校验并批量删除智能体的对话信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentService.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentService.java deleted file mode 100644 index 40f199c..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IAiAgentService.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.dromara.ai.service; - -import org.dromara.ai.domain.vo.AiAgentVo; -import org.dromara.ai.domain.bo.AiAgentBo; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; - -import java.util.Collection; -import java.util.List; - -/** - * 智能体Service接口 - * - * @author Lion Li - * @date 2024-11-07 - */ -public interface IAiAgentService { - - /** - * 查询智能体 - * - * @param id 主键 - * @return 智能体 - */ - AiAgentVo queryById(Long id); - - /** - * 分页查询智能体列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 智能体分页列表 - */ - TableDataInfo queryPageList(AiAgentBo bo, PageQuery pageQuery); - - /** - * 查询符合条件的智能体列表 - * - * @param bo 查询条件 - * @return 智能体列表 - */ - List queryList(AiAgentBo bo); - - /** - * 新增智能体 - * - * @param bo 智能体 - * @return 是否新增成功 - */ - Boolean insertByBo(AiAgentBo bo); - - /** - * 修改智能体 - * - * @param bo 智能体 - * @return 是否修改成功 - */ - Boolean updateByBo(AiAgentBo bo); - - /** - * 校验并批量删除智能体信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatService.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatService.java deleted file mode 100644 index bcfe583..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatService.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.dromara.ai.service; - -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.ai.domain.bo.AiChatMessageBo; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import reactor.core.publisher.Flux; - -import java.util.List; - -public interface IChatService { - - /** - * 查询我的对话列表 - */ - TableDataInfo listMyChats(AiAgentChatBo bo, PageQuery pageQuery); - - /** - * 获取我的聊天记录 - */ - TableDataInfo getMyChatMessages(Long chatId, PageQuery pageQuery); - - /*** - * 发送消息给AI - */ - String sendMessage(AiChatMessageBo message); - - /*** - * 发送消息给AI,流式返回数据 - */ - Flux sendMessageFlux(AiChatMessageBo message); -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatServiceNew.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatServiceNew.java deleted file mode 100644 index 06c7e65..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/IChatServiceNew.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.dromara.ai.service; - -public interface IChatServiceNew { -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatHistoryServiceImpl.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatHistoryServiceImpl.java deleted file mode 100644 index d0c48f2..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatHistoryServiceImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -package org.dromara.ai.service.impl; - -import org.dromara.ai.constant.AiMessageRoleConstant; -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; -import org.dromara.ai.domain.bo.AiAgentChatHistoryBo; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.AiAgentChatHistory; -import org.dromara.ai.mapper.AiAgentChatHistoryMapper; -import org.dromara.ai.service.IAiAgentChatHistoryService; - -import java.util.List; -import java.util.Map; -import java.util.Collection; - -/** - * 聊天记录Service业务层处理 - * - * @author Lion Li - * @date 2024-11-07 - */ -@RequiredArgsConstructor -@Service -public class AiAgentChatHistoryServiceImpl implements IAiAgentChatHistoryService { - - private final AiAgentChatHistoryMapper baseMapper; - - /** - * 查询聊天记录 - * - * @param id 主键 - * @return 聊天记录 - */ - @Override - public AiAgentChatHistoryVo queryById(Long id){ - return baseMapper.selectVoById(id); - } - - /** - * 分页查询聊天记录列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 聊天记录分页列表 - */ - @Override - public TableDataInfo queryPageList(AiAgentChatHistoryBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询符合条件的聊天记录列表 - * - * @param bo 查询条件 - * @return 聊天记录列表 - */ - @Override - public List queryList(AiAgentChatHistoryBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - @Override - public List querySystemOverallList(Long agentId) { - - LambdaQueryWrapper lqw = Wrappers.lambdaQuery() - .eq(AiAgentChatHistory::getRole, AiMessageRoleConstant.SYSTEM) - .and(n -> { - n.isNull(AiAgentChatHistory::getAgentChatId) - .eq(AiAgentChatHistory::getAgentId, agentId) - .or() - .isNull(AiAgentChatHistory::getAgentId); - }); - - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(AiAgentChatHistoryBo bo) { - Map params = bo.getParams(); - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(bo.getAgentChatId() != null, AiAgentChatHistory::getAgentChatId, bo.getAgentChatId()); - lqw.eq(StringUtils.isNotBlank(bo.getRole()), AiAgentChatHistory::getRole, bo.getRole()); - lqw.eq(StringUtils.isNotBlank(bo.getMessage()), AiAgentChatHistory::getMessage, bo.getMessage()); - lqw.eq(bo.getAiSort() != null, AiAgentChatHistory::getAiSort, bo.getAiSort()); - return lqw; - } - - /** - * 新增聊天记录 - * - * @param bo 聊天记录 - * @return 是否新增成功 - */ - @Override - public Boolean insertByBo(AiAgentChatHistoryBo bo) { - AiAgentChatHistory add = MapstructUtils.convert(bo, AiAgentChatHistory.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - - /** - * 修改聊天记录 - * - * @param bo 聊天记录 - * @return 是否修改成功 - */ - @Override - public Boolean updateByBo(AiAgentChatHistoryBo bo) { - AiAgentChatHistory update = MapstructUtils.convert(bo, AiAgentChatHistory.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; - } - - /** - * 保存前的数据校验 - */ - private void validEntityBeforeSave(AiAgentChatHistory entity){ - //TODO 做一些数据校验,如唯一约束 - } - - /** - * 校验并批量删除聊天记录信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteByIds(ids) > 0; - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatServiceImpl.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatServiceImpl.java deleted file mode 100644 index f1d2df6..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentChatServiceImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -package org.dromara.ai.service.impl; - -import org.dromara.ai.domain.AiAgent; -import org.dromara.ai.mapper.AiAgentMapper; -import org.dromara.common.core.domain.dto.UserDTO; -import org.dromara.common.core.service.UserService; -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import lombok.RequiredArgsConstructor; -import org.dromara.system.mapper.SysUserMapper; -import org.springframework.stereotype.Service; -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.ai.domain.AiAgentChat; -import org.dromara.ai.mapper.AiAgentChatMapper; -import org.dromara.ai.service.IAiAgentChatService; - -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 智能体的对话Service业务层处理 - * - * @author Lion Li - * @date 2024-11-07 - */ -@RequiredArgsConstructor -@Service -public class AiAgentChatServiceImpl implements IAiAgentChatService { - - private final AiAgentChatMapper baseMapper; - private final AiAgentMapper aiAgentMapper; - private final UserService userService; -// private final SysUserMapper userMapper; - - /** - * 查询智能体的对话 - * - * @param id 主键 - * @return 智能体的对话 - */ - @Override - public AiAgentChatVo queryById(Long id){ - return baseMapper.selectVoById(id); - } - - /** - * 分页查询智能体的对话列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 智能体的对话分页列表 - */ - @Override - public TableDataInfo queryPageList(AiAgentChatBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - - if(bo.getParams().containsKey("extend")){ - setExtendInfo(result.getRecords()); - } - - return TableDataInfo.build(result); - } - - /** - * 查询符合条件的智能体的对话列表 - * - * @param bo 查询条件 - * @return 智能体的对话列表 - */ - @Override - public List queryList(AiAgentChatBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(AiAgentChatBo bo) { - Map params = bo.getParams(); - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.eq(bo.getAgentId() != null, AiAgentChat::getAgentId, bo.getAgentId()); - lqw.eq(bo.getUid() != null, AiAgentChat::getUid, bo.getUid()); - lqw.like(StringUtils.isNotBlank(bo.getChatName()), AiAgentChat::getChatName, bo.getChatName()); - lqw.eq(bo.getAiSort() != null, AiAgentChat::getAiSort, bo.getAiSort()); - return lqw; - } - - /** - * 新增智能体的对话 - * - * @param bo 智能体的对话 - * @return 是否新增成功 - */ - @Override - public Boolean insertByBo(AiAgentChatBo bo) { - AiAgentChat add = MapstructUtils.convert(bo, AiAgentChat.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - - /** - * 修改智能体的对话 - * - * @param bo 智能体的对话 - * @return 是否修改成功 - */ - @Override - public Boolean updateByBo(AiAgentChatBo bo) { - AiAgentChat update = MapstructUtils.convert(bo, AiAgentChat.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; - } - - /** - * 保存前的数据校验 - */ - private void validEntityBeforeSave(AiAgentChat entity){ - //TODO 做一些数据校验,如唯一约束 - } - - /** - * 校验并批量删除智能体的对话信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteByIds(ids) > 0; - } - - public void setExtendInfo(List list){ - List uidList = list.stream().map(item -> item.getUid()).collect(Collectors.toList()); - List agentIdList = list.stream().map(item -> item.getAgentId()).collect(Collectors.toList()); - - HashMap userDTOS = userService - .selectListByIds(uidList).stream() - .collect(Collectors.toMap(UserDTO::getUserId, - Function.identity(), (k1, k2) -> k1, HashMap::new)); - - HashMap aiAgents = aiAgentMapper - .selectList(Wrappers.lambdaQuery() - .in(AiAgent::getId, agentIdList) - .select(AiAgent::getId, AiAgent::getName)) - .stream() - .collect(Collectors.toMap(AiAgent::getId, - Function.identity(), (k1, k2) -> k1, HashMap::new)); - - list.forEach(item->{ - item.setAgentName(aiAgents.get(item.getAgentId()).getName()); - item.setNickName(userDTOS.get(item.getUid()).getNickName()); - }); - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentServiceImpl.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentServiceImpl.java deleted file mode 100644 index 19fd1c1..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/AiAgentServiceImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.dromara.ai.service.impl; - -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; -import org.dromara.ai.domain.bo.AiAgentBo; -import org.dromara.ai.domain.vo.AiAgentVo; -import org.dromara.ai.domain.AiAgent; -import org.dromara.ai.mapper.AiAgentMapper; -import org.dromara.ai.service.IAiAgentService; - -import java.util.List; -import java.util.Map; -import java.util.Collection; - -/** - * 智能体Service业务层处理 - * - * @author Lion Li - * @date 2024-11-07 - */ -@RequiredArgsConstructor -@Service -public class AiAgentServiceImpl implements IAiAgentService { - - private final AiAgentMapper baseMapper; - - /** - * 查询智能体 - * - * @param id 主键 - * @return 智能体 - */ - @Override - public AiAgentVo queryById(Long id){ - return baseMapper.selectVoById(id); - } - - /** - * 分页查询智能体列表 - * - * @param bo 查询条件 - * @param pageQuery 分页参数 - * @return 智能体分页列表 - */ - @Override - public TableDataInfo queryPageList(AiAgentBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询符合条件的智能体列表 - * - * @param bo 查询条件 - * @return 智能体列表 - */ - @Override - public List queryList(AiAgentBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(AiAgentBo bo) { - Map params = bo.getParams(); - LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getName()), AiAgent::getName, bo.getName()); - lqw.eq(bo.getStatus() != null, AiAgent::getStatus, bo.getStatus()); - lqw.eq(bo.getAiSort() != null, AiAgent::getAiSort, bo.getAiSort()); - return lqw; - } - - /** - * 新增智能体 - * - * @param bo 智能体 - * @return 是否新增成功 - */ - @Override - public Boolean insertByBo(AiAgentBo bo) { - AiAgent add = MapstructUtils.convert(bo, AiAgent.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - - /** - * 修改智能体 - * - * @param bo 智能体 - * @return 是否修改成功 - */ - @Override - public Boolean updateByBo(AiAgentBo bo) { - AiAgent update = MapstructUtils.convert(bo, AiAgent.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; - } - - /** - * 保存前的数据校验 - */ - private void validEntityBeforeSave(AiAgent entity){ - //TODO 做一些数据校验,如唯一约束 - } - - /** - * 校验并批量删除智能体信息 - * - * @param ids 待删除的主键集合 - * @param isValid 是否进行有效性校验 - * @return 是否删除成功 - */ - @Override - public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteByIds(ids) > 0; - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/ChatServiceImpl.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/ChatServiceImpl.java deleted file mode 100644 index 2440210..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/ChatServiceImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.dromara.ai.service.impl; - -import lombok.RequiredArgsConstructor; -import org.dromara.ai.constant.AiMessageRoleConstant; -import org.dromara.ai.constant.AiModelTypeConstant; -import org.dromara.ai.domain.bo.AiAgentChatBo; -import org.dromara.ai.domain.bo.AiAgentChatHistoryBo; -import org.dromara.ai.domain.bo.AiChatMessageBo; -import org.dromara.ai.domain.vo.AiAgentChatHistoryVo; -import org.dromara.ai.domain.vo.AiAgentChatVo; -import org.dromara.ai.domain.vo.AiAgentVo; -import org.dromara.ai.mapper.AiAgentChatHistoryMapper; -import org.dromara.ai.service.IAiAgentChatHistoryService; -import org.dromara.ai.service.IAiAgentChatService; -import org.dromara.ai.service.IAiAgentService; -import org.dromara.ai.service.IChatService; -import org.dromara.common.mybatis.core.page.PageQuery; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.springframework.ai.chat.messages.AssistantMessage; -import org.springframework.ai.chat.messages.Message; -import org.springframework.ai.chat.messages.SystemMessage; -import org.springframework.ai.chat.messages.UserMessage; -import org.springframework.ai.chat.prompt.ChatOptions; -import org.springframework.ai.chat.prompt.Prompt; -import org.springframework.ai.ollama.OllamaChatClient; -import org.springframework.ai.ollama.api.OllamaOptions; -import org.springframework.ai.openai.OpenAiChatClient; -import org.springframework.ai.openai.OpenAiChatOptions; -import org.springframework.stereotype.Service; -import reactor.core.publisher.Flux; - -import java.util.ArrayList; -import java.util.List; - -@Service -@RequiredArgsConstructor -public class ChatServiceImpl implements IChatService { - - private final OpenAiChatClient openAiChatClient; - private final OllamaChatClient ollamaChatClient; - - private final IAiAgentService aiAgentService; - private final IAiAgentChatService aiAgentChatService; - private final IAiAgentChatHistoryService aiAgentChatHistoryService; - - - @Override - public TableDataInfo listMyChats(AiAgentChatBo bo, PageQuery pageQuery) { - return aiAgentChatService.queryPageList(bo, pageQuery); - } - - @Override - public TableDataInfo getMyChatMessages(Long chatId, PageQuery pageQuery) { - return aiAgentChatHistoryService - .queryPageList(AiAgentChatHistoryBo.builder() - .agentChatId(chatId) - .build(), pageQuery); - } - - @Override - public String sendMessage(AiChatMessageBo message) { - - String content = ollamaChatClient.call(buildPrompt(message)).getResult().getOutput().getContent(); - - //插入对话智能体的历史记录 - aiAgentChatHistoryService.insertByBo(AiAgentChatHistoryBo.builder() - .agentChatId(message.getChatId()) - .message(content) - .agentId(message.getAgentId()) - .role(AiMessageRoleConstant.ASSISTANT) - .build()); - - return content; - } - - @Override - public Flux sendMessageFlux(AiChatMessageBo message) { - return ollamaChatClient.stream(buildPrompt(message)) - .map((response -> response.getResult().getOutput().getContent())); - } - - - /** - * 构建提示 - * @param message - * @return - */ - private Prompt buildPrompt(AiChatMessageBo message) { - - //查询智能体 -// AiAgentVo aiAgentVo = aiAgentService.queryById(message.getAgentId()); - - //插入对话用户的历史记录 - aiAgentChatHistoryService.insertByBo(AiAgentChatHistoryBo.builder() - .agentChatId(message.getChatId()) - .message(message.getMessage()) - .agentId(message.getAgentId()) - .role(AiMessageRoleConstant.USER) - .build()); - - ChatOptions chatOptions = null; - - if (AiModelTypeConstant.OPENAI.equals(message.getModelType())) { - chatOptions = OpenAiChatOptions.builder().build(); - }else{ - chatOptions = OllamaOptions.create(); - } - - return new Prompt(buildMessage(message), chatOptions); - } - - /** - * 构建消息 - * @param message - * @return - */ - private List buildMessage(AiChatMessageBo message) { - - // 根据智能体id查询智能体全局system消息 - List listSystem = aiAgentChatHistoryService.querySystemOverallList(message.getAgentId()); - - // 根据id查询对话历史记录 - List list = aiAgentChatHistoryService - .queryList(AiAgentChatHistoryBo.builder() - .agentChatId(message.getChatId()) - .build()); - -// list.addAll(list2); - - ArrayList messages = new ArrayList<>(); - - // 根据角色添加消息 - for (AiAgentChatHistoryVo vo : list) { - if (AiMessageRoleConstant.ASSISTANT.equals(vo.getRole())) { - messages.add(new AssistantMessage(vo.getMessage())); - }else if (AiMessageRoleConstant.USER.equals(vo.getRole())){ - messages.add(new UserMessage(vo.getMessage())); - }else{ - messages.add(new SystemMessage(vo.getMessage())); - } - } - - return messages; - } -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/IChatServiceNewImpl.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/IChatServiceNewImpl.java deleted file mode 100644 index 793129b..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/service/impl/IChatServiceNewImpl.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.dromara.ai.service.impl; - -import lombok.RequiredArgsConstructor; -import org.dromara.ai.service.IChatServiceNew; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -public class IChatServiceNewImpl implements IChatServiceNew { -} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwCases.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwCases.java new file mode 100644 index 0000000..6930fd6 --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwCases.java @@ -0,0 +1,93 @@ +package org.dromara.officialWebsite.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; + +import java.io.Serial; + +/** + * 项目案例对象 ow_cases + * + * @author Lion Li + * @date 2025-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ow_cases") +public class OwCases extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 编号 + */ + @TableId(value = "id") + private Long id; + + /** + * 标题 + */ + private String title; + + /** + * 简介 + */ + private String description; + + /** + * 主图 + */ + private String image; + + /** + * 分类 + */ + private Long categoryId; + + /** + * 客户名称 + */ + private String client; + + /** + * 完成日期 + */ + private String completionDate; + + /** + * 客户面临的挑战 + */ + private String challenge; + + /** + * 提供的解决方案 + */ + private String solution; + + /** + * 项目成果 + */ + private String results; + + /** + * 详情 + */ + private String content; + + /** + * 客户评价 + */ + private String testimonial; + + /** + * 评价人及职位 + */ + private String testimonialAuthor; + + +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgent.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwDevelopmentHistory.java similarity index 63% rename from java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgent.java rename to java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwDevelopmentHistory.java index c6f4d2a..9931b2e 100644 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgent.java +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwDevelopmentHistory.java @@ -1,4 +1,4 @@ -package org.dromara.ai.domain; +package org.dromara.officialWebsite.domain; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; @@ -8,15 +8,15 @@ import lombok.EqualsAndHashCode; import java.io.Serial; /** - * 智能体对象 ai_agent + * OW发展历程对象 ow_development_history * * @author Lion Li - * @date 2024-11-07 + * @date 2025-05-15 */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("ai_agent") -public class AiAgent extends BaseEntity { +@TableName("ow_development_history") +public class OwDevelopmentHistory extends BaseEntity { @Serial private static final long serialVersionUID = 1L; @@ -28,24 +28,19 @@ public class AiAgent extends BaseEntity { private Long id; /** - * 智能体名称 + * 日期 */ - private String name; + private String date; /** - * 状态 + * 标题 */ - private Long status; + private String title; /** - * 备注 + * 说明 */ - private String remark; - - /** - * 排序 - */ - private Long aiSort; + private String content; /** * 删除标志(0代表存在 2代表删除) diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChat.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwLeaveMessage.java similarity index 61% rename from java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChat.java rename to java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwLeaveMessage.java index ab83b43..a619b44 100644 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChat.java +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwLeaveMessage.java @@ -1,4 +1,4 @@ -package org.dromara.ai.domain; +package org.dromara.officialWebsite.domain; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; @@ -8,15 +8,15 @@ import lombok.EqualsAndHashCode; import java.io.Serial; /** - * 智能体的对话对象 ai_agent_chat + * 留言对象 ow_leave_message * * @author Lion Li - * @date 2024-11-07 + * @date 2025-05-15 */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("ai_agent_chat") -public class AiAgentChat extends BaseEntity { +@TableName("ow_leave_message") +public class OwLeaveMessage extends BaseEntity { @Serial private static final long serialVersionUID = 1L; @@ -28,24 +28,19 @@ public class AiAgentChat extends BaseEntity { private Long id; /** - * 智能体id + * 姓名 */ - private Long agentId; + private String username; /** - * 用户id + * 电话 */ - private Long uid; + private String phone; /** - * 对话名称 + * 内容 */ - private String chatName; - - /** - * 排序 - */ - private Long aiSort; + private String content; /** * 删除标志(0代表存在 2代表删除) diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChatHistory.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwServiceProcess.java similarity index 51% rename from java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChatHistory.java rename to java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwServiceProcess.java index 1a988d1..42bf599 100644 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/AiAgentChatHistory.java +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/OwServiceProcess.java @@ -1,22 +1,24 @@ -package org.dromara.ai.domain; +package org.dromara.officialWebsite.domain; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import java.io.Serial; /** - * 聊天记录对象 ai_agent_chat_history + * 服务流程对象 ow_service_process * * @author Lion Li - * @date 2024-11-07 + * @date 2025-05-15 */ @Data @EqualsAndHashCode(callSuper = true) -@TableName("ai_agent_chat_history") -public class AiAgentChatHistory extends BaseEntity { +@TableName("ow_service_process") +public class OwServiceProcess extends BaseEntity { @Serial private static final long serialVersionUID = 1L; @@ -28,29 +30,29 @@ public class AiAgentChatHistory extends BaseEntity { private Long id; /** - * 对话id + * 图标图片 */ - private Long agentChatId; + private String image; /** - * 智能体id + * 标题 */ - private Long agentId; + private String title; /** - * 对话身份 + * 说明文本 */ - private String role; + private String info; /** - * 对话内容 + * 说明详情富文本 */ - private String message; + private String content; /** - * 排序 + * 排序(标题序号) */ - private Long aiSort; + private Long sort; /** * 删除标志(0代表存在 2代表删除) diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentVo.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/vo/OwLeaveMessageVo.java similarity index 50% rename from java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentVo.java rename to java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/vo/OwLeaveMessageVo.java index 630e790..df6e147 100644 --- a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/ai/domain/vo/AiAgentVo.java +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/domain/vo/OwLeaveMessageVo.java @@ -1,6 +1,6 @@ -package org.dromara.ai.domain.vo; +package org.dromara.officialWebsite.domain.vo; -import org.dromara.ai.domain.AiAgent; +import org.dromara.officialWebsite.domain.OwLeaveMessage; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import org.dromara.common.excel.annotation.ExcelDictFormat; @@ -15,15 +15,15 @@ import java.util.Date; /** - * 智能体视图对象 ai_agent + * 留言视图对象 ow_leave_message * * @author Lion Li - * @date 2024-11-07 + * @date 2025-05-15 */ @Data @ExcelIgnoreUnannotated -@AutoMapper(target = AiAgent.class) -public class AiAgentVo implements Serializable { +@AutoMapper(target = OwLeaveMessage.class) +public class OwLeaveMessageVo implements Serializable { @Serial private static final long serialVersionUID = 1L; @@ -35,29 +35,22 @@ public class AiAgentVo implements Serializable { private Long id; /** - * 智能体名称 + * 姓名 */ - @ExcelProperty(value = "智能体名称") - private String name; + @ExcelProperty(value = "姓名") + private String username; /** - * 状态 + * 电话 */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "ai_agent_status") - private Long status; + @ExcelProperty(value = "电话") + private String phone; /** - * 备注 + * 内容 */ - @ExcelProperty(value = "备注") - private String remark; - - /** - * 排序 - */ - @ExcelProperty(value = "排序") - private Long aiSort; + @ExcelProperty(value = "内容") + private String content; } diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCaseCategoryController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCaseCategoryController.java new file mode 100644 index 0000000..43bb1a4 --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCaseCategoryController.java @@ -0,0 +1,34 @@ +package org.dromara.officialWebsite.front.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import lombok.RequiredArgsConstructor; +import org.dromara.common.web.core.BaseController; +import org.dromara.officialWebsite.domain.bo.OwCaseCategoryBo; +import org.dromara.officialWebsite.domain.vo.OwCaseCategoryVo; +import org.dromara.officialWebsite.service.IOwCaseCategoryService; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 案例分类 + * + * @author Lion Li + * @date 2025-05-13 + */ +@SaIgnore +@RequiredArgsConstructor +@RestController +@RequestMapping("/api/officialWebsite/caseCategory") +public class OwCaseCategoryController extends BaseController { + + private final IOwCaseCategoryService owCaseCategoryService; + + /** + * 查询案例分类列表 + */ + @GetMapping("/list") + public List list() { + return owCaseCategoryService.queryList(OwCaseCategoryBo.builder().build()); + } +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCasesController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCasesController.java new file mode 100644 index 0000000..5436472 --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontCasesController.java @@ -0,0 +1,105 @@ +package org.dromara.officialWebsite.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.officialWebsite.domain.vo.OwCasesVo; +import org.dromara.officialWebsite.domain.bo.OwCasesBo; +import org.dromara.officialWebsite.service.IOwCasesService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 项目案例 + * + * @author Lion Li + * @date 2025-05-13 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/officialWebsite/cases") +public class OwCasesController extends BaseController { + + private final IOwCasesService owCasesService; + + /** + * 查询项目案例列表 + */ + @SaCheckPermission("officialWebsite:cases:list") + @GetMapping("/list") + public TableDataInfo list(OwCasesBo bo, PageQuery pageQuery) { + return owCasesService.queryPageList(bo, pageQuery); + } + + /** + * 导出项目案例列表 + */ + @SaCheckPermission("officialWebsite:cases:export") + @Log(title = "项目案例", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OwCasesBo bo, HttpServletResponse response) { + List list = owCasesService.queryList(bo); + ExcelUtil.exportExcel(list, "项目案例", OwCasesVo.class, response); + } + + /** + * 获取项目案例详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("officialWebsite:cases:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(owCasesService.queryById(id)); + } + + /** + * 新增项目案例 + */ + @SaCheckPermission("officialWebsite:cases:add") + @Log(title = "项目案例", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OwCasesBo bo) { + return toAjax(owCasesService.insertByBo(bo)); + } + + /** + * 修改项目案例 + */ + @SaCheckPermission("officialWebsite:cases:edit") + @Log(title = "项目案例", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OwCasesBo bo) { + return toAjax(owCasesService.updateByBo(bo)); + } + + /** + * 删除项目案例 + * + * @param ids 主键串 + */ + @SaCheckPermission("officialWebsite:cases:remove") + @Log(title = "项目案例", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(owCasesService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontConfigParamsController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontConfigParamsController.java new file mode 100644 index 0000000..2b7c352 --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontConfigParamsController.java @@ -0,0 +1,49 @@ +package org.dromara.officialWebsite.front.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaIgnore; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.officialWebsite.domain.bo.OwConfigParamsBo; +import org.dromara.officialWebsite.domain.vo.OwConfigParamsVo; +import org.dromara.officialWebsite.service.IOwConfigParamsService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 配置参数 + * + * @author Lion Li + * @date 2025-05-13 + */ +@SaIgnore +@RequiredArgsConstructor +@RestController +@RequestMapping("/api/officialWebsite/configParams") +public class OwConfigParamsController extends BaseController { + + private final IOwConfigParamsService owConfigParamsService; + + /** + * 查询配置参数列表 + */ + @GetMapping("/list") + public List list() { + return owConfigParamsService.queryList(OwConfigParamsBo.builder().build()); + } + +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontDevelopmentHistoryController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontDevelopmentHistoryController.java new file mode 100644 index 0000000..56dc29e --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontDevelopmentHistoryController.java @@ -0,0 +1,105 @@ +package org.dromara.officialWebsite.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.officialWebsite.domain.vo.OwDevelopmentHistoryVo; +import org.dromara.officialWebsite.domain.bo.OwDevelopmentHistoryBo; +import org.dromara.officialWebsite.service.IOwDevelopmentHistoryService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * OW发展历程 + * + * @author Lion Li + * @date 2025-05-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/officialWebsite/developmentHistory") +public class OwDevelopmentHistoryController extends BaseController { + + private final IOwDevelopmentHistoryService owDevelopmentHistoryService; + + /** + * 查询OW发展历程列表 + */ + @SaCheckPermission("officialWebsite:developmentHistory:list") + @GetMapping("/list") + public TableDataInfo list(OwDevelopmentHistoryBo bo, PageQuery pageQuery) { + return owDevelopmentHistoryService.queryPageList(bo, pageQuery); + } + + /** + * 导出OW发展历程列表 + */ + @SaCheckPermission("officialWebsite:developmentHistory:export") + @Log(title = "OW发展历程", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OwDevelopmentHistoryBo bo, HttpServletResponse response) { + List list = owDevelopmentHistoryService.queryList(bo); + ExcelUtil.exportExcel(list, "OW发展历程", OwDevelopmentHistoryVo.class, response); + } + + /** + * 获取OW发展历程详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("officialWebsite:developmentHistory:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(owDevelopmentHistoryService.queryById(id)); + } + + /** + * 新增OW发展历程 + */ + @SaCheckPermission("officialWebsite:developmentHistory:add") + @Log(title = "OW发展历程", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OwDevelopmentHistoryBo bo) { + return toAjax(owDevelopmentHistoryService.insertByBo(bo)); + } + + /** + * 修改OW发展历程 + */ + @SaCheckPermission("officialWebsite:developmentHistory:edit") + @Log(title = "OW发展历程", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OwDevelopmentHistoryBo bo) { + return toAjax(owDevelopmentHistoryService.updateByBo(bo)); + } + + /** + * 删除OW发展历程 + * + * @param ids 主键串 + */ + @SaCheckPermission("officialWebsite:developmentHistory:remove") + @Log(title = "OW发展历程", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(owDevelopmentHistoryService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontLeaveMessageController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontLeaveMessageController.java new file mode 100644 index 0000000..dac625d --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontLeaveMessageController.java @@ -0,0 +1,105 @@ +package org.dromara.officialWebsite.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.officialWebsite.domain.vo.OwLeaveMessageVo; +import org.dromara.officialWebsite.domain.bo.OwLeaveMessageBo; +import org.dromara.officialWebsite.service.IOwLeaveMessageService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 留言 + * + * @author Lion Li + * @date 2025-05-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/officialWebsite/leaveMessage") +public class OwLeaveMessageController extends BaseController { + + private final IOwLeaveMessageService owLeaveMessageService; + + /** + * 查询留言列表 + */ + @SaCheckPermission("officialWebsite:leaveMessage:list") + @GetMapping("/list") + public TableDataInfo list(OwLeaveMessageBo bo, PageQuery pageQuery) { + return owLeaveMessageService.queryPageList(bo, pageQuery); + } + + /** + * 导出留言列表 + */ + @SaCheckPermission("officialWebsite:leaveMessage:export") + @Log(title = "留言", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OwLeaveMessageBo bo, HttpServletResponse response) { + List list = owLeaveMessageService.queryList(bo); + ExcelUtil.exportExcel(list, "留言", OwLeaveMessageVo.class, response); + } + + /** + * 获取留言详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("officialWebsite:leaveMessage:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(owLeaveMessageService.queryById(id)); + } + + /** + * 新增留言 + */ + @SaCheckPermission("officialWebsite:leaveMessage:add") + @Log(title = "留言", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OwLeaveMessageBo bo) { + return toAjax(owLeaveMessageService.insertByBo(bo)); + } + + /** + * 修改留言 + */ + @SaCheckPermission("officialWebsite:leaveMessage:edit") + @Log(title = "留言", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OwLeaveMessageBo bo) { + return toAjax(owLeaveMessageService.updateByBo(bo)); + } + + /** + * 删除留言 + * + * @param ids 主键串 + */ + @SaCheckPermission("officialWebsite:leaveMessage:remove") + @Log(title = "留言", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(owLeaveMessageService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontServiceProcessController.java b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontServiceProcessController.java new file mode 100644 index 0000000..81b151d --- /dev/null +++ b/java-api/ruoyi-modules/h-project/src/main/java/org/dromara/officialWebsite/front/controller/OwFrontServiceProcessController.java @@ -0,0 +1,105 @@ +package org.dromara.officialWebsite.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.officialWebsite.domain.vo.OwServiceProcessVo; +import org.dromara.officialWebsite.domain.bo.OwServiceProcessBo; +import org.dromara.officialWebsite.service.IOwServiceProcessService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 服务流程 + * + * @author Lion Li + * @date 2025-05-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/officialWebsite/serviceProcess") +public class OwServiceProcessController extends BaseController { + + private final IOwServiceProcessService owServiceProcessService; + + /** + * 查询服务流程列表 + */ + @SaCheckPermission("officialWebsite:serviceProcess:list") + @GetMapping("/list") + public TableDataInfo list(OwServiceProcessBo bo, PageQuery pageQuery) { + return owServiceProcessService.queryPageList(bo, pageQuery); + } + + /** + * 导出服务流程列表 + */ + @SaCheckPermission("officialWebsite:serviceProcess:export") + @Log(title = "服务流程", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OwServiceProcessBo bo, HttpServletResponse response) { + List list = owServiceProcessService.queryList(bo); + ExcelUtil.exportExcel(list, "服务流程", OwServiceProcessVo.class, response); + } + + /** + * 获取服务流程详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("officialWebsite:serviceProcess:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(owServiceProcessService.queryById(id)); + } + + /** + * 新增服务流程 + */ + @SaCheckPermission("officialWebsite:serviceProcess:add") + @Log(title = "服务流程", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OwServiceProcessBo bo) { + return toAjax(owServiceProcessService.insertByBo(bo)); + } + + /** + * 修改服务流程 + */ + @SaCheckPermission("officialWebsite:serviceProcess:edit") + @Log(title = "服务流程", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OwServiceProcessBo bo) { + return toAjax(owServiceProcessService.updateByBo(bo)); + } + + /** + * 删除服务流程 + * + * @param ids 主键串 + */ + @SaCheckPermission("officialWebsite:serviceProcess:remove") + @Log(title = "服务流程", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(owServiceProcessService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatHistoryMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatHistoryMapper.xml deleted file mode 100644 index 7a1009d..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatHistoryMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatMapper.xml deleted file mode 100644 index 88d0f09..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentChatMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentMapper.xml deleted file mode 100644 index 13a20fb..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/ai/AiAgentMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmAmountRecordMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmAmountRecordMapper.xml deleted file mode 100644 index 5ebd474..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmAmountRecordMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMapper.xml deleted file mode 100644 index 5ce1162..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMemberMapper.xml b/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMemberMapper.xml deleted file mode 100644 index 0c0c257..0000000 --- a/java-api/ruoyi-modules/h-project/src/main/resources/mapper/project/PmProjectMemberMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - -