|
@@ -1,10 +1,16 @@
|
|
package cn.iocoder.yudao.module.ai.controller;
|
|
package cn.iocoder.yudao.module.ai.controller;
|
|
|
|
|
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
+import cn.iocoder.yudao.module.ai.service.ChatMessageService;
|
|
|
|
+import cn.iocoder.yudao.module.ai.vo.ChatMessageListRes;
|
|
|
|
+import cn.iocoder.yudao.module.ai.vo.ChatMessageReq;
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* chat message
|
|
* chat message
|
|
@@ -15,8 +21,24 @@ import org.springframework.web.bind.annotation.RestController;
|
|
*/
|
|
*/
|
|
@Tag(name = "A3-聊天-对话")
|
|
@Tag(name = "A3-聊天-对话")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/ai/chat/conversation")
|
|
|
|
|
|
+@RequestMapping("/ai/chat/message")
|
|
@Slf4j
|
|
@Slf4j
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class ChatMessageController {
|
|
public class ChatMessageController {
|
|
|
|
+
|
|
|
|
+ private final ChatMessageService chatMessageService;
|
|
|
|
+
|
|
|
|
+ @Operation(summary = "聊天记录", description = "查询个人的聊天记录")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public PageResult<ChatMessageListRes> list(@Validated @ModelAttribute ChatMessageReq req) {
|
|
|
|
+ return chatMessageService.list(req);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Operation(summary = "聊天记录", description = "查询个人的聊天记录")
|
|
|
|
+ @DeleteMapping("/{chatConversationId}/{id}")
|
|
|
|
+ public CommonResult delete(@PathVariable("chatConversationId") Long chatConversationId,
|
|
|
|
+ @PathVariable("id") Long id) {
|
|
|
|
+ chatMessageService.delete(chatConversationId, id);
|
|
|
|
+ return CommonResult.success(null);
|
|
|
|
+ }
|
|
}
|
|
}
|