From 687eef95b64d27a5582d6de4aa7d9febea573233 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Thu, 11 Apr 2024 21:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89chat=20role=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/AiChatRoleController.java | 57 +++++++++++++++++++ .../ai/controller/app/vo/ChatRoleAddReq.java | 20 +++++++ .../ai/controller/app/vo/ChatRoleListReq.java | 20 +++++++ .../ai/controller/app/vo/ChatRoleListRes.java | 15 +++++ .../controller/app/vo/ChatRoleUpdateReq.java | 20 +++++++ .../app/vo/ChatRoleUpdateVisibilityReq.java | 20 +++++++ .../module/ai/service/ChatRoleService.java | 52 +++++++++++++++++ .../ai/service/ChatRoleServiceImpl.java | 45 +++++++++++++++ 8 files changed, 249 insertions(+) create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/AiChatRoleController.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleAddReq.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListReq.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListRes.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateReq.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateVisibilityReq.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleService.java create mode 100644 yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleServiceImpl.java diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/AiChatRoleController.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/AiChatRoleController.java new file mode 100644 index 000000000..7103e3702 --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/AiChatRoleController.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.ai.controller.app; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.ai.controller.app.vo.*; +import cn.iocoder.yudao.module.ai.service.ChatRoleService; +import io.swagger.v3.oas.annotations.Operation; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * ai chat 角色 + * + * @fansili + * @since v1.0 + */ +@RestController +@RequestMapping("/chat-role") +@AllArgsConstructor +public class AiChatRoleController { + + private final ChatRoleService chatRoleService; + + @Operation(summary = "chat角色 - 角色列表") + @GetMapping("/list") + public CommonResult list(@Validated @ModelAttribute ChatRoleListReq req) { + return chatRoleService.list(req); + } + + @Operation(summary = "chat角色 - 添加") + @PutMapping("/add") + public CommonResult add(@Validated @RequestBody ChatRoleAddReq req) { + chatRoleService.add(req); + return CommonResult.success(null); + } + + @Operation(summary = "chat角色 - 修改") + @PostMapping("/update") + public CommonResult update(@Validated @RequestBody ChatRoleUpdateReq req) { + chatRoleService.update(req); + return CommonResult.success(null); + } + + @Operation(summary = "chat角色 - 修改可见性") + @PostMapping("/update-visibility") + public CommonResult updateVisibility(@Validated @RequestBody ChatRoleUpdateVisibilityReq req) { + chatRoleService.updateVisibility(req); + return CommonResult.success(null); + } + + @Operation(summary = "chat角色 - 修改可见性") + @DeleteMapping("/delete") + public CommonResult delete(@RequestParam("chatRoleId") Long chatRoleId) { + chatRoleService.delete(chatRoleId); + return CommonResult.success(null); + } +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleAddReq.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleAddReq.java new file mode 100644 index 000000000..b3957fafd --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleAddReq.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.ai.controller.app.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * chat 角色列表 + * + * @fansili + * @since v1.0 + */ +@Data +@Accessors(chain = true) +public class ChatRoleAddReq extends PageParam { + + @Schema(description = "查询") + private String search; +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListReq.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListReq.java new file mode 100644 index 000000000..355f00cf6 --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListReq.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.ai.controller.app.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * chat 角色列表 + * + * @fansili + * @since v1.0 + */ +@Data +@Accessors(chain = true) +public class ChatRoleListReq extends PageParam { + + @Schema(description = "查询") + private String search; +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListRes.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListRes.java new file mode 100644 index 000000000..d788e7876 --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleListRes.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.ai.controller.app.vo; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * chat 角色列表 + * + * @fansili + * @since v1.0 + */ +@Data +@Accessors(chain = true) +public class ChatRoleListRes { +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateReq.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateReq.java new file mode 100644 index 000000000..f5a894881 --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateReq.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.ai.controller.app.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * chat 角色 - 更新 + * + * @fansili + * @since v1.0 + */ +@Data +@Accessors(chain = true) +public class ChatRoleUpdateReq extends PageParam { + + @Schema(description = "查询") + private String search; +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateVisibilityReq.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateVisibilityReq.java new file mode 100644 index 000000000..bd1836b5e --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/app/vo/ChatRoleUpdateVisibilityReq.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.ai.controller.app.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * chat 角色 - 修改可见性 + * + * @fansili + * @since v1.0 + */ +@Data +@Accessors(chain = true) +public class ChatRoleUpdateVisibilityReq extends PageParam { + + @Schema(description = "查询") + private String search; +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleService.java new file mode 100644 index 000000000..725ce7779 --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleService.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.ai.service; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.ai.controller.app.vo.*; + +/** + * chat 角色 + * + * @fansili + * @since v1.0 + */ +public interface ChatRoleService { + + /** + * 获取聊天角色列表 + * + * @param req + * @return + */ + CommonResult list(ChatRoleListReq req); + + /** + * chat角色 - 添加 + * + * @param req + * @return + */ + ChatRoleListRes add(ChatRoleAddReq req); + + /** + * chat角色 - 修改 + * + * @param req + */ + void update(ChatRoleUpdateReq req); + + + /** + * chat角色 - 修改可见性 + * + * @param req + */ + void updateVisibility(ChatRoleUpdateVisibilityReq req); + + /** + * chat角色 - 删除 + * + * @param chatRoleId + */ + void delete(Long chatRoleId); + +} diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleServiceImpl.java new file mode 100644 index 000000000..7b930218a --- /dev/null +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/ChatRoleServiceImpl.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.module.ai.service; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.ai.controller.app.vo.*; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * chat 角色 + * + * @fansili + * @since v1.0 + */ +@Service +@AllArgsConstructor +@Slf4j +public class ChatRoleServiceImpl implements ChatRoleService { + + + @Override + public CommonResult list(ChatRoleListReq req) { + return null; + } + + @Override + public ChatRoleListRes add(ChatRoleAddReq req) { + return null; + } + + @Override + public void update(ChatRoleUpdateReq req) { + + } + + @Override + public void updateVisibility(ChatRoleUpdateVisibilityReq req) { + + } + + @Override + public void delete(Long chatRoleId) { + + } +}