Parcourir la source

建立聊天记录、文件、主题表

lamphua il y a 1 semaine
Parent
révision
662be7bcbc
32 fichiers modifiés avec 1811 ajouts et 18 suppressions
  1. 104
    0
      llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcChatController.java
  2. 104
    0
      llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcDocumentController.java
  3. 104
    0
      llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcTopicController.java
  4. 125
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcChat.java
  5. 65
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcDocument.java
  6. 52
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcTopic.java
  7. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcChatMapper.java
  8. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcDocumentMapper.java
  9. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcTopicMapper.java
  10. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcChatService.java
  11. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcDocumentService.java
  12. 61
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcTopicService.java
  13. 93
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcChatServiceImpl.java
  14. 93
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcDocumentServiceImpl.java
  15. 95
    0
      llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcTopicServiceImpl.java
  16. 83
    0
      llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcChatMapper.xml
  17. 63
    0
      llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcDocumentMapper.xml
  18. 62
    0
      llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcTopicMapper.xml
  19. 52
    3
      llm-back/sql/ry_20240629.sql
  20. 2
    2
      llm-ui/.env.development
  21. 2
    2
      llm-ui/.env.production
  22. 2
    2
      llm-ui/.env.staging
  23. 1
    1
      llm-ui/index.html
  24. 2
    2
      llm-ui/package.json
  25. 50
    0
      llm-ui/src/api/llm/chat.js
  26. 44
    0
      llm-ui/src/api/llm/document.js
  27. 44
    0
      llm-ui/src/api/llm/topic.js
  28. 4
    3
      llm-ui/src/layout/components/Navbar.vue
  29. 5
    0
      llm-ui/src/router/index.js
  30. 185
    0
      llm-ui/src/views/chat.vue
  31. 2
    2
      llm-ui/src/views/login.vue
  32. 7
    1
      llm-ui/vite.config.js

+ 104
- 0
llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcChatController.java Voir le fichier

@@ -0,0 +1,104 @@
1
+package com.ruoyi.web.controller.llm;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.security.access.prepost.PreAuthorize;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.PostMapping;
9
+import org.springframework.web.bind.annotation.PutMapping;
10
+import org.springframework.web.bind.annotation.DeleteMapping;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import com.ruoyi.common.annotation.Log;
16
+import com.ruoyi.common.core.controller.BaseController;
17
+import com.ruoyi.common.core.domain.AjaxResult;
18
+import com.ruoyi.common.enums.BusinessType;
19
+import com.ruoyi.llm.domain.CmcChat;
20
+import com.ruoyi.llm.service.ICmcChatService;
21
+import com.ruoyi.common.utils.poi.ExcelUtil;
22
+import com.ruoyi.common.core.page.TableDataInfo;
23
+
24
+/**
25
+ * cmc聊天记录Controller
26
+ * 
27
+ * @author cmc
28
+ * @date 2025-04-08
29
+ */
30
+@RestController
31
+@RequestMapping("/llm/chat")
32
+public class CmcChatController extends BaseController
33
+{
34
+    @Autowired
35
+    private ICmcChatService cmcChatService;
36
+
37
+    /**
38
+     * 查询cmc聊天记录列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('llm:chat:list')")
41
+    @GetMapping("/list")
42
+    public TableDataInfo list(CmcChat cmcChat)
43
+    {
44
+        startPage();
45
+        List<CmcChat> list = cmcChatService.selectCmcChatList(cmcChat);
46
+        return getDataTable(list);
47
+    }
48
+
49
+    /**
50
+     * 导出cmc聊天记录列表
51
+     */
52
+    @PreAuthorize("@ss.hasPermi('llm:chat:export')")
53
+    @Log(title = "cmc聊天记录", businessType = BusinessType.EXPORT)
54
+    @PostMapping("/export")
55
+    public void export(HttpServletResponse response, CmcChat cmcChat)
56
+    {
57
+        List<CmcChat> list = cmcChatService.selectCmcChatList(cmcChat);
58
+        ExcelUtil<CmcChat> util = new ExcelUtil<CmcChat>(CmcChat.class);
59
+        util.exportExcel(response, list, "cmc聊天记录数据");
60
+    }
61
+
62
+    /**
63
+     * 获取cmc聊天记录详细信息
64
+     */
65
+    @PreAuthorize("@ss.hasPermi('llm:chat:query')")
66
+    @GetMapping(value = "/{chatId}")
67
+    public AjaxResult getInfo(@PathVariable("chatId") String chatId)
68
+    {
69
+        return success(cmcChatService.selectCmcChatByChatId(chatId));
70
+    }
71
+
72
+    /**
73
+     * 新增cmc聊天记录
74
+     */
75
+    @PreAuthorize("@ss.hasPermi('llm:chat:add')")
76
+    @Log(title = "cmc聊天记录", businessType = BusinessType.INSERT)
77
+    @PostMapping
78
+    public AjaxResult add(@RequestBody CmcChat cmcChat)
79
+    {
80
+        return toAjax(cmcChatService.insertCmcChat(cmcChat));
81
+    }
82
+
83
+    /**
84
+     * 修改cmc聊天记录
85
+     */
86
+    @PreAuthorize("@ss.hasPermi('llm:chat:edit')")
87
+    @Log(title = "cmc聊天记录", businessType = BusinessType.UPDATE)
88
+    @PutMapping
89
+    public AjaxResult edit(@RequestBody CmcChat cmcChat)
90
+    {
91
+        return toAjax(cmcChatService.updateCmcChat(cmcChat));
92
+    }
93
+
94
+    /**
95
+     * 删除cmc聊天记录
96
+     */
97
+    @PreAuthorize("@ss.hasPermi('llm:chat:remove')")
98
+    @Log(title = "cmc聊天记录", businessType = BusinessType.DELETE)
99
+	@DeleteMapping("/{chatIds}")
100
+    public AjaxResult remove(@PathVariable String[] chatIds)
101
+    {
102
+        return toAjax(cmcChatService.deleteCmcChatByChatIds(chatIds));
103
+    }
104
+}

+ 104
- 0
llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcDocumentController.java Voir le fichier

@@ -0,0 +1,104 @@
1
+package com.ruoyi.web.controller.llm;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.security.access.prepost.PreAuthorize;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.PostMapping;
9
+import org.springframework.web.bind.annotation.PutMapping;
10
+import org.springframework.web.bind.annotation.DeleteMapping;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import com.ruoyi.common.annotation.Log;
16
+import com.ruoyi.common.core.controller.BaseController;
17
+import com.ruoyi.common.core.domain.AjaxResult;
18
+import com.ruoyi.common.enums.BusinessType;
19
+import com.ruoyi.llm.domain.CmcDocument;
20
+import com.ruoyi.llm.service.ICmcDocumentService;
21
+import com.ruoyi.common.utils.poi.ExcelUtil;
22
+import com.ruoyi.common.core.page.TableDataInfo;
23
+
24
+/**
25
+ * cmc聊天附件Controller
26
+ * 
27
+ * @author cmc
28
+ * @date 2025-04-08
29
+ */
30
+@RestController
31
+@RequestMapping("/llm/document")
32
+public class CmcDocumentController extends BaseController
33
+{
34
+    @Autowired
35
+    private ICmcDocumentService cmcDocumentService;
36
+
37
+    /**
38
+     * 查询cmc聊天附件列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('llm:document:list')")
41
+    @GetMapping("/list")
42
+    public TableDataInfo list(CmcDocument cmcDocument)
43
+    {
44
+        startPage();
45
+        List<CmcDocument> list = cmcDocumentService.selectCmcDocumentList(cmcDocument);
46
+        return getDataTable(list);
47
+    }
48
+
49
+    /**
50
+     * 导出cmc聊天附件列表
51
+     */
52
+    @PreAuthorize("@ss.hasPermi('llm:document:export')")
53
+    @Log(title = "cmc聊天附件", businessType = BusinessType.EXPORT)
54
+    @PostMapping("/export")
55
+    public void export(HttpServletResponse response, CmcDocument cmcDocument)
56
+    {
57
+        List<CmcDocument> list = cmcDocumentService.selectCmcDocumentList(cmcDocument);
58
+        ExcelUtil<CmcDocument> util = new ExcelUtil<CmcDocument>(CmcDocument.class);
59
+        util.exportExcel(response, list, "cmc聊天附件数据");
60
+    }
61
+
62
+    /**
63
+     * 获取cmc聊天附件详细信息
64
+     */
65
+    @PreAuthorize("@ss.hasPermi('llm:document:query')")
66
+    @GetMapping(value = "/{documentId}")
67
+    public AjaxResult getInfo(@PathVariable("documentId") String documentId)
68
+    {
69
+        return success(cmcDocumentService.selectCmcDocumentByDocumentId(documentId));
70
+    }
71
+
72
+    /**
73
+     * 新增cmc聊天附件
74
+     */
75
+    @PreAuthorize("@ss.hasPermi('llm:document:add')")
76
+    @Log(title = "cmc聊天附件", businessType = BusinessType.INSERT)
77
+    @PostMapping
78
+    public AjaxResult add(@RequestBody CmcDocument cmcDocument)
79
+    {
80
+        return toAjax(cmcDocumentService.insertCmcDocument(cmcDocument));
81
+    }
82
+
83
+    /**
84
+     * 修改cmc聊天附件
85
+     */
86
+    @PreAuthorize("@ss.hasPermi('llm:document:edit')")
87
+    @Log(title = "cmc聊天附件", businessType = BusinessType.UPDATE)
88
+    @PutMapping
89
+    public AjaxResult edit(@RequestBody CmcDocument cmcDocument)
90
+    {
91
+        return toAjax(cmcDocumentService.updateCmcDocument(cmcDocument));
92
+    }
93
+
94
+    /**
95
+     * 删除cmc聊天附件
96
+     */
97
+    @PreAuthorize("@ss.hasPermi('llm:document:remove')")
98
+    @Log(title = "cmc聊天附件", businessType = BusinessType.DELETE)
99
+	@DeleteMapping("/{documentIds}")
100
+    public AjaxResult remove(@PathVariable String[] documentIds)
101
+    {
102
+        return toAjax(cmcDocumentService.deleteCmcDocumentByDocumentIds(documentIds));
103
+    }
104
+}

+ 104
- 0
llm-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/llm/CmcTopicController.java Voir le fichier

@@ -0,0 +1,104 @@
1
+package com.ruoyi.web.controller.llm;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.security.access.prepost.PreAuthorize;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.PostMapping;
9
+import org.springframework.web.bind.annotation.PutMapping;
10
+import org.springframework.web.bind.annotation.DeleteMapping;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import com.ruoyi.common.annotation.Log;
16
+import com.ruoyi.common.core.controller.BaseController;
17
+import com.ruoyi.common.core.domain.AjaxResult;
18
+import com.ruoyi.common.enums.BusinessType;
19
+import com.ruoyi.llm.domain.CmcTopic;
20
+import com.ruoyi.llm.service.ICmcTopicService;
21
+import com.ruoyi.common.utils.poi.ExcelUtil;
22
+import com.ruoyi.common.core.page.TableDataInfo;
23
+
24
+/**
25
+ * cmc聊天主题Controller
26
+ * 
27
+ * @author cmc
28
+ * @date 2025-04-08
29
+ */
30
+@RestController
31
+@RequestMapping("/llm/topic")
32
+public class CmcTopicController extends BaseController
33
+{
34
+    @Autowired
35
+    private ICmcTopicService cmcTopicService;
36
+
37
+    /**
38
+     * 查询cmc聊天主题列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('llm:topic:list')")
41
+    @GetMapping("/list")
42
+    public TableDataInfo list(CmcTopic cmcTopic)
43
+    {
44
+        startPage();
45
+        List<CmcTopic> list = cmcTopicService.selectCmcTopicList(cmcTopic);
46
+        return getDataTable(list);
47
+    }
48
+
49
+    /**
50
+     * 导出cmc聊天主题列表
51
+     */
52
+    @PreAuthorize("@ss.hasPermi('llm:topic:export')")
53
+    @Log(title = "cmc聊天主题", businessType = BusinessType.EXPORT)
54
+    @PostMapping("/export")
55
+    public void export(HttpServletResponse response, CmcTopic cmcTopic)
56
+    {
57
+        List<CmcTopic> list = cmcTopicService.selectCmcTopicList(cmcTopic);
58
+        ExcelUtil<CmcTopic> util = new ExcelUtil<CmcTopic>(CmcTopic.class);
59
+        util.exportExcel(response, list, "cmc聊天主题数据");
60
+    }
61
+
62
+    /**
63
+     * 获取cmc聊天主题详细信息
64
+     */
65
+    @PreAuthorize("@ss.hasPermi('llm:topic:query')")
66
+    @GetMapping(value = "/{topicId}")
67
+    public AjaxResult getInfo(@PathVariable("topicId") String topicId)
68
+    {
69
+        return success(cmcTopicService.selectCmcTopicByTopicId(topicId));
70
+    }
71
+
72
+    /**
73
+     * 新增cmc聊天主题
74
+     */
75
+    @PreAuthorize("@ss.hasPermi('llm:topic:add')")
76
+    @Log(title = "cmc聊天主题", businessType = BusinessType.INSERT)
77
+    @PostMapping
78
+    public AjaxResult add(@RequestBody CmcTopic cmcTopic)
79
+    {
80
+        return toAjax(cmcTopicService.insertCmcTopic(cmcTopic));
81
+    }
82
+
83
+    /**
84
+     * 修改cmc聊天主题
85
+     */
86
+    @PreAuthorize("@ss.hasPermi('llm:topic:edit')")
87
+    @Log(title = "cmc聊天主题", businessType = BusinessType.UPDATE)
88
+    @PutMapping
89
+    public AjaxResult edit(@RequestBody CmcTopic cmcTopic)
90
+    {
91
+        return toAjax(cmcTopicService.updateCmcTopic(cmcTopic));
92
+    }
93
+
94
+    /**
95
+     * 删除cmc聊天主题
96
+     */
97
+    @PreAuthorize("@ss.hasPermi('llm:topic:remove')")
98
+    @Log(title = "cmc聊天主题", businessType = BusinessType.DELETE)
99
+	@DeleteMapping("/{topicIds}")
100
+    public AjaxResult remove(@PathVariable String[] topicIds)
101
+    {
102
+        return toAjax(cmcTopicService.deleteCmcTopicByTopicIds(topicIds));
103
+    }
104
+}

+ 125
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcChat.java Voir le fichier

@@ -0,0 +1,125 @@
1
+package com.ruoyi.llm.domain;
2
+
3
+import java.util.Date;
4
+import com.fasterxml.jackson.annotation.JsonFormat;
5
+import org.apache.commons.lang3.builder.ToStringBuilder;
6
+import org.apache.commons.lang3.builder.ToStringStyle;
7
+import com.ruoyi.common.annotation.Excel;
8
+import com.ruoyi.common.core.domain.BaseEntity;
9
+
10
+/**
11
+ * cmc聊天记录对象 cmc_chat
12
+ * 
13
+ * @author cmc
14
+ * @date 2025-04-08
15
+ */
16
+public class CmcChat extends BaseEntity
17
+{
18
+    private static final long serialVersionUID = 1L;
19
+
20
+    /** 聊天记录id */
21
+    private String chatId;
22
+
23
+    /** 聊天主题id */
24
+    @Excel(name = "聊天主题id")
25
+    private String topicId;
26
+
27
+    /** 用户id */
28
+    @Excel(name = "用户id")
29
+    private Long userId;
30
+
31
+    /** 输入 */
32
+    @Excel(name = "输入")
33
+    private String input;
34
+
35
+    /** 输入时间 */
36
+    @JsonFormat(pattern = "yyyy-MM-dd")
37
+    @Excel(name = "输入时间", width = 30, dateFormat = "yyyy-MM-dd")
38
+    private Date inputTime;
39
+
40
+    /** 输出 */
41
+    @Excel(name = "输出")
42
+    private String output;
43
+
44
+    /** 输出时间 */
45
+    @JsonFormat(pattern = "yyyy-MM-dd")
46
+    @Excel(name = "输出时间", width = 30, dateFormat = "yyyy-MM-dd")
47
+    private Date outputTime;
48
+
49
+    public void setChatId(String chatId) 
50
+    {
51
+        this.chatId = chatId;
52
+    }
53
+
54
+    public String getChatId() 
55
+    {
56
+        return chatId;
57
+    }
58
+    public void setTopicId(String topicId) 
59
+    {
60
+        this.topicId = topicId;
61
+    }
62
+
63
+    public String getTopicId() 
64
+    {
65
+        return topicId;
66
+    }
67
+    public void setUserId(Long userId) 
68
+    {
69
+        this.userId = userId;
70
+    }
71
+
72
+    public Long getUserId() 
73
+    {
74
+        return userId;
75
+    }
76
+    public void setInput(String input) 
77
+    {
78
+        this.input = input;
79
+    }
80
+
81
+    public String getInput() 
82
+    {
83
+        return input;
84
+    }
85
+    public void setInputTime(Date inputTime) 
86
+    {
87
+        this.inputTime = inputTime;
88
+    }
89
+
90
+    public Date getInputTime() 
91
+    {
92
+        return inputTime;
93
+    }
94
+    public void setOutput(String output) 
95
+    {
96
+        this.output = output;
97
+    }
98
+
99
+    public String getOutput() 
100
+    {
101
+        return output;
102
+    }
103
+    public void setOutputTime(Date outputTime) 
104
+    {
105
+        this.outputTime = outputTime;
106
+    }
107
+
108
+    public Date getOutputTime() 
109
+    {
110
+        return outputTime;
111
+    }
112
+
113
+    @Override
114
+    public String toString() {
115
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
116
+            .append("chatId", getChatId())
117
+            .append("topicId", getTopicId())
118
+            .append("userId", getUserId())
119
+            .append("input", getInput())
120
+            .append("inputTime", getInputTime())
121
+            .append("output", getOutput())
122
+            .append("outputTime", getOutputTime())
123
+            .toString();
124
+    }
125
+}

+ 65
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcDocument.java Voir le fichier

@@ -0,0 +1,65 @@
1
+package com.ruoyi.llm.domain;
2
+
3
+import org.apache.commons.lang3.builder.ToStringBuilder;
4
+import org.apache.commons.lang3.builder.ToStringStyle;
5
+import com.ruoyi.common.annotation.Excel;
6
+import com.ruoyi.common.core.domain.BaseEntity;
7
+
8
+/**
9
+ * cmc聊天附件对象 cmc_document
10
+ * 
11
+ * @author cmc
12
+ * @date 2025-04-08
13
+ */
14
+public class CmcDocument extends BaseEntity
15
+{
16
+    private static final long serialVersionUID = 1L;
17
+
18
+    /** 附件id */
19
+    private String documentId;
20
+
21
+    /** 聊天记录id */
22
+    @Excel(name = "聊天记录id")
23
+    private String chatId;
24
+
25
+    /** 附件 */
26
+    @Excel(name = "附件")
27
+    private String path;
28
+
29
+    public void setDocumentId(String documentId) 
30
+    {
31
+        this.documentId = documentId;
32
+    }
33
+
34
+    public String getDocumentId() 
35
+    {
36
+        return documentId;
37
+    }
38
+    public void setChatId(String chatId) 
39
+    {
40
+        this.chatId = chatId;
41
+    }
42
+
43
+    public String getChatId() 
44
+    {
45
+        return chatId;
46
+    }
47
+    public void setPath(String path) 
48
+    {
49
+        this.path = path;
50
+    }
51
+
52
+    public String getPath() 
53
+    {
54
+        return path;
55
+    }
56
+
57
+    @Override
58
+    public String toString() {
59
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
60
+            .append("documentId", getDocumentId())
61
+            .append("chatId", getChatId())
62
+            .append("path", getPath())
63
+            .toString();
64
+    }
65
+}

+ 52
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/domain/CmcTopic.java Voir le fichier

@@ -0,0 +1,52 @@
1
+package com.ruoyi.llm.domain;
2
+
3
+import org.apache.commons.lang3.builder.ToStringBuilder;
4
+import org.apache.commons.lang3.builder.ToStringStyle;
5
+import com.ruoyi.common.annotation.Excel;
6
+import com.ruoyi.common.core.domain.BaseEntity;
7
+
8
+/**
9
+ * cmc聊天主题对象 cmc_topic
10
+ * 
11
+ * @author cmc
12
+ * @date 2025-04-08
13
+ */
14
+public class CmcTopic extends BaseEntity
15
+{
16
+    private static final long serialVersionUID = 1L;
17
+
18
+    /** 聊天主题id */
19
+    private String topicId;
20
+
21
+    /** 主题 */
22
+    @Excel(name = "主题")
23
+    private String topic;
24
+
25
+    public void setTopicId(String topicId) 
26
+    {
27
+        this.topicId = topicId;
28
+    }
29
+
30
+    public String getTopicId() 
31
+    {
32
+        return topicId;
33
+    }
34
+    public void setTopic(String topic) 
35
+    {
36
+        this.topic = topic;
37
+    }
38
+
39
+    public String getTopic() 
40
+    {
41
+        return topic;
42
+    }
43
+
44
+    @Override
45
+    public String toString() {
46
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
47
+            .append("topicId", getTopicId())
48
+            .append("topic", getTopic())
49
+            .append("createTime", getCreateTime())
50
+            .toString();
51
+    }
52
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcChatMapper.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcChat;
5
+
6
+/**
7
+ * cmc聊天记录Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface CmcChatMapper 
13
+{
14
+    /**
15
+     * 查询cmc聊天记录
16
+     * 
17
+     * @param chatId cmc聊天记录主键
18
+     * @return cmc聊天记录
19
+     */
20
+    public CmcChat selectCmcChatByChatId(String chatId);
21
+
22
+    /**
23
+     * 查询cmc聊天记录列表
24
+     * 
25
+     * @param cmcChat cmc聊天记录
26
+     * @return cmc聊天记录集合
27
+     */
28
+    public List<CmcChat> selectCmcChatList(CmcChat cmcChat);
29
+
30
+    /**
31
+     * 新增cmc聊天记录
32
+     * 
33
+     * @param cmcChat cmc聊天记录
34
+     * @return 结果
35
+     */
36
+    public int insertCmcChat(CmcChat cmcChat);
37
+
38
+    /**
39
+     * 修改cmc聊天记录
40
+     * 
41
+     * @param cmcChat cmc聊天记录
42
+     * @return 结果
43
+     */
44
+    public int updateCmcChat(CmcChat cmcChat);
45
+
46
+    /**
47
+     * 删除cmc聊天记录
48
+     * 
49
+     * @param chatId cmc聊天记录主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcChatByChatId(String chatId);
53
+
54
+    /**
55
+     * 批量删除cmc聊天记录
56
+     * 
57
+     * @param chatIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcChatByChatIds(String[] chatIds);
61
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcDocumentMapper.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcDocument;
5
+
6
+/**
7
+ * cmc聊天附件Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface CmcDocumentMapper 
13
+{
14
+    /**
15
+     * 查询cmc聊天附件
16
+     * 
17
+     * @param documentId cmc聊天附件主键
18
+     * @return cmc聊天附件
19
+     */
20
+    public CmcDocument selectCmcDocumentByDocumentId(String documentId);
21
+
22
+    /**
23
+     * 查询cmc聊天附件列表
24
+     * 
25
+     * @param cmcDocument cmc聊天附件
26
+     * @return cmc聊天附件集合
27
+     */
28
+    public List<CmcDocument> selectCmcDocumentList(CmcDocument cmcDocument);
29
+
30
+    /**
31
+     * 新增cmc聊天附件
32
+     * 
33
+     * @param cmcDocument cmc聊天附件
34
+     * @return 结果
35
+     */
36
+    public int insertCmcDocument(CmcDocument cmcDocument);
37
+
38
+    /**
39
+     * 修改cmc聊天附件
40
+     * 
41
+     * @param cmcDocument cmc聊天附件
42
+     * @return 结果
43
+     */
44
+    public int updateCmcDocument(CmcDocument cmcDocument);
45
+
46
+    /**
47
+     * 删除cmc聊天附件
48
+     * 
49
+     * @param documentId cmc聊天附件主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcDocumentByDocumentId(String documentId);
53
+
54
+    /**
55
+     * 批量删除cmc聊天附件
56
+     * 
57
+     * @param documentIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcDocumentByDocumentIds(String[] documentIds);
61
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/mapper/CmcTopicMapper.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcTopic;
5
+
6
+/**
7
+ * cmc聊天主题Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface CmcTopicMapper 
13
+{
14
+    /**
15
+     * 查询cmc聊天主题
16
+     * 
17
+     * @param topicId cmc聊天主题主键
18
+     * @return cmc聊天主题
19
+     */
20
+    public CmcTopic selectCmcTopicByTopicId(String topicId);
21
+
22
+    /**
23
+     * 查询cmc聊天主题列表
24
+     * 
25
+     * @param cmcTopic cmc聊天主题
26
+     * @return cmc聊天主题集合
27
+     */
28
+    public List<CmcTopic> selectCmcTopicList(CmcTopic cmcTopic);
29
+
30
+    /**
31
+     * 新增cmc聊天主题
32
+     * 
33
+     * @param cmcTopic cmc聊天主题
34
+     * @return 结果
35
+     */
36
+    public int insertCmcTopic(CmcTopic cmcTopic);
37
+
38
+    /**
39
+     * 修改cmc聊天主题
40
+     * 
41
+     * @param cmcTopic cmc聊天主题
42
+     * @return 结果
43
+     */
44
+    public int updateCmcTopic(CmcTopic cmcTopic);
45
+
46
+    /**
47
+     * 删除cmc聊天主题
48
+     * 
49
+     * @param topicId cmc聊天主题主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcTopicByTopicId(String topicId);
53
+
54
+    /**
55
+     * 批量删除cmc聊天主题
56
+     * 
57
+     * @param topicIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcTopicByTopicIds(String[] topicIds);
61
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcChatService.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcChat;
5
+
6
+/**
7
+ * cmc聊天记录Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface ICmcChatService 
13
+{
14
+    /**
15
+     * 查询cmc聊天记录
16
+     * 
17
+     * @param chatId cmc聊天记录主键
18
+     * @return cmc聊天记录
19
+     */
20
+    public CmcChat selectCmcChatByChatId(String chatId);
21
+
22
+    /**
23
+     * 查询cmc聊天记录列表
24
+     * 
25
+     * @param cmcChat cmc聊天记录
26
+     * @return cmc聊天记录集合
27
+     */
28
+    public List<CmcChat> selectCmcChatList(CmcChat cmcChat);
29
+
30
+    /**
31
+     * 新增cmc聊天记录
32
+     * 
33
+     * @param cmcChat cmc聊天记录
34
+     * @return 结果
35
+     */
36
+    public int insertCmcChat(CmcChat cmcChat);
37
+
38
+    /**
39
+     * 修改cmc聊天记录
40
+     * 
41
+     * @param cmcChat cmc聊天记录
42
+     * @return 结果
43
+     */
44
+    public int updateCmcChat(CmcChat cmcChat);
45
+
46
+    /**
47
+     * 批量删除cmc聊天记录
48
+     * 
49
+     * @param chatIds 需要删除的cmc聊天记录主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcChatByChatIds(String[] chatIds);
53
+
54
+    /**
55
+     * 删除cmc聊天记录信息
56
+     * 
57
+     * @param chatId cmc聊天记录主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcChatByChatId(String chatId);
61
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcDocumentService.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcDocument;
5
+
6
+/**
7
+ * cmc聊天附件Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface ICmcDocumentService 
13
+{
14
+    /**
15
+     * 查询cmc聊天附件
16
+     * 
17
+     * @param documentId cmc聊天附件主键
18
+     * @return cmc聊天附件
19
+     */
20
+    public CmcDocument selectCmcDocumentByDocumentId(String documentId);
21
+
22
+    /**
23
+     * 查询cmc聊天附件列表
24
+     * 
25
+     * @param cmcDocument cmc聊天附件
26
+     * @return cmc聊天附件集合
27
+     */
28
+    public List<CmcDocument> selectCmcDocumentList(CmcDocument cmcDocument);
29
+
30
+    /**
31
+     * 新增cmc聊天附件
32
+     * 
33
+     * @param cmcDocument cmc聊天附件
34
+     * @return 结果
35
+     */
36
+    public int insertCmcDocument(CmcDocument cmcDocument);
37
+
38
+    /**
39
+     * 修改cmc聊天附件
40
+     * 
41
+     * @param cmcDocument cmc聊天附件
42
+     * @return 结果
43
+     */
44
+    public int updateCmcDocument(CmcDocument cmcDocument);
45
+
46
+    /**
47
+     * 批量删除cmc聊天附件
48
+     * 
49
+     * @param documentIds 需要删除的cmc聊天附件主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcDocumentByDocumentIds(String[] documentIds);
53
+
54
+    /**
55
+     * 删除cmc聊天附件信息
56
+     * 
57
+     * @param documentId cmc聊天附件主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcDocumentByDocumentId(String documentId);
61
+}

+ 61
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/ICmcTopicService.java Voir le fichier

@@ -0,0 +1,61 @@
1
+package com.ruoyi.llm.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.llm.domain.CmcTopic;
5
+
6
+/**
7
+ * cmc聊天主题Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-04-08
11
+ */
12
+public interface ICmcTopicService 
13
+{
14
+    /**
15
+     * 查询cmc聊天主题
16
+     * 
17
+     * @param topicId cmc聊天主题主键
18
+     * @return cmc聊天主题
19
+     */
20
+    public CmcTopic selectCmcTopicByTopicId(String topicId);
21
+
22
+    /**
23
+     * 查询cmc聊天主题列表
24
+     * 
25
+     * @param cmcTopic cmc聊天主题
26
+     * @return cmc聊天主题集合
27
+     */
28
+    public List<CmcTopic> selectCmcTopicList(CmcTopic cmcTopic);
29
+
30
+    /**
31
+     * 新增cmc聊天主题
32
+     * 
33
+     * @param cmcTopic cmc聊天主题
34
+     * @return 结果
35
+     */
36
+    public int insertCmcTopic(CmcTopic cmcTopic);
37
+
38
+    /**
39
+     * 修改cmc聊天主题
40
+     * 
41
+     * @param cmcTopic cmc聊天主题
42
+     * @return 结果
43
+     */
44
+    public int updateCmcTopic(CmcTopic cmcTopic);
45
+
46
+    /**
47
+     * 批量删除cmc聊天主题
48
+     * 
49
+     * @param topicIds 需要删除的cmc聊天主题主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcTopicByTopicIds(String[] topicIds);
53
+
54
+    /**
55
+     * 删除cmc聊天主题信息
56
+     * 
57
+     * @param topicId cmc聊天主题主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcTopicByTopicId(String topicId);
61
+}

+ 93
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcChatServiceImpl.java Voir le fichier

@@ -0,0 +1,93 @@
1
+package com.ruoyi.llm.service.impl;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.ruoyi.llm.mapper.CmcChatMapper;
7
+import com.ruoyi.llm.domain.CmcChat;
8
+import com.ruoyi.llm.service.ICmcChatService;
9
+
10
+/**
11
+ * cmc聊天记录Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2025-04-08
15
+ */
16
+@Service
17
+public class CmcChatServiceImpl implements ICmcChatService 
18
+{
19
+    @Autowired
20
+    private CmcChatMapper cmcChatMapper;
21
+
22
+    /**
23
+     * 查询cmc聊天记录
24
+     * 
25
+     * @param chatId cmc聊天记录主键
26
+     * @return cmc聊天记录
27
+     */
28
+    @Override
29
+    public CmcChat selectCmcChatByChatId(String chatId)
30
+    {
31
+        return cmcChatMapper.selectCmcChatByChatId(chatId);
32
+    }
33
+
34
+    /**
35
+     * 查询cmc聊天记录列表
36
+     * 
37
+     * @param cmcChat cmc聊天记录
38
+     * @return cmc聊天记录
39
+     */
40
+    @Override
41
+    public List<CmcChat> selectCmcChatList(CmcChat cmcChat)
42
+    {
43
+        return cmcChatMapper.selectCmcChatList(cmcChat);
44
+    }
45
+
46
+    /**
47
+     * 新增cmc聊天记录
48
+     * 
49
+     * @param cmcChat cmc聊天记录
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcChat(CmcChat cmcChat)
54
+    {
55
+        return cmcChatMapper.insertCmcChat(cmcChat);
56
+    }
57
+
58
+    /**
59
+     * 修改cmc聊天记录
60
+     * 
61
+     * @param cmcChat cmc聊天记录
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcChat(CmcChat cmcChat)
66
+    {
67
+        return cmcChatMapper.updateCmcChat(cmcChat);
68
+    }
69
+
70
+    /**
71
+     * 批量删除cmc聊天记录
72
+     * 
73
+     * @param chatIds 需要删除的cmc聊天记录主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcChatByChatIds(String[] chatIds)
78
+    {
79
+        return cmcChatMapper.deleteCmcChatByChatIds(chatIds);
80
+    }
81
+
82
+    /**
83
+     * 删除cmc聊天记录信息
84
+     * 
85
+     * @param chatId cmc聊天记录主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcChatByChatId(String chatId)
90
+    {
91
+        return cmcChatMapper.deleteCmcChatByChatId(chatId);
92
+    }
93
+}

+ 93
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcDocumentServiceImpl.java Voir le fichier

@@ -0,0 +1,93 @@
1
+package com.ruoyi.llm.service.impl;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.ruoyi.llm.mapper.CmcDocumentMapper;
7
+import com.ruoyi.llm.domain.CmcDocument;
8
+import com.ruoyi.llm.service.ICmcDocumentService;
9
+
10
+/**
11
+ * cmc聊天附件Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2025-04-08
15
+ */
16
+@Service
17
+public class CmcDocumentServiceImpl implements ICmcDocumentService 
18
+{
19
+    @Autowired
20
+    private CmcDocumentMapper cmcDocumentMapper;
21
+
22
+    /**
23
+     * 查询cmc聊天附件
24
+     * 
25
+     * @param documentId cmc聊天附件主键
26
+     * @return cmc聊天附件
27
+     */
28
+    @Override
29
+    public CmcDocument selectCmcDocumentByDocumentId(String documentId)
30
+    {
31
+        return cmcDocumentMapper.selectCmcDocumentByDocumentId(documentId);
32
+    }
33
+
34
+    /**
35
+     * 查询cmc聊天附件列表
36
+     * 
37
+     * @param cmcDocument cmc聊天附件
38
+     * @return cmc聊天附件
39
+     */
40
+    @Override
41
+    public List<CmcDocument> selectCmcDocumentList(CmcDocument cmcDocument)
42
+    {
43
+        return cmcDocumentMapper.selectCmcDocumentList(cmcDocument);
44
+    }
45
+
46
+    /**
47
+     * 新增cmc聊天附件
48
+     * 
49
+     * @param cmcDocument cmc聊天附件
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcDocument(CmcDocument cmcDocument)
54
+    {
55
+        return cmcDocumentMapper.insertCmcDocument(cmcDocument);
56
+    }
57
+
58
+    /**
59
+     * 修改cmc聊天附件
60
+     * 
61
+     * @param cmcDocument cmc聊天附件
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcDocument(CmcDocument cmcDocument)
66
+    {
67
+        return cmcDocumentMapper.updateCmcDocument(cmcDocument);
68
+    }
69
+
70
+    /**
71
+     * 批量删除cmc聊天附件
72
+     * 
73
+     * @param documentIds 需要删除的cmc聊天附件主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcDocumentByDocumentIds(String[] documentIds)
78
+    {
79
+        return cmcDocumentMapper.deleteCmcDocumentByDocumentIds(documentIds);
80
+    }
81
+
82
+    /**
83
+     * 删除cmc聊天附件信息
84
+     * 
85
+     * @param documentId cmc聊天附件主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcDocumentByDocumentId(String documentId)
90
+    {
91
+        return cmcDocumentMapper.deleteCmcDocumentByDocumentId(documentId);
92
+    }
93
+}

+ 95
- 0
llm-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcTopicServiceImpl.java Voir le fichier

@@ -0,0 +1,95 @@
1
+package com.ruoyi.llm.service.impl;
2
+
3
+import java.util.List;
4
+import com.ruoyi.common.utils.DateUtils;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.stereotype.Service;
7
+import com.ruoyi.llm.mapper.CmcTopicMapper;
8
+import com.ruoyi.llm.domain.CmcTopic;
9
+import com.ruoyi.llm.service.ICmcTopicService;
10
+
11
+/**
12
+ * cmc聊天主题Service业务层处理
13
+ * 
14
+ * @author cmc
15
+ * @date 2025-04-08
16
+ */
17
+@Service
18
+public class CmcTopicServiceImpl implements ICmcTopicService 
19
+{
20
+    @Autowired
21
+    private CmcTopicMapper cmcTopicMapper;
22
+
23
+    /**
24
+     * 查询cmc聊天主题
25
+     * 
26
+     * @param topicId cmc聊天主题主键
27
+     * @return cmc聊天主题
28
+     */
29
+    @Override
30
+    public CmcTopic selectCmcTopicByTopicId(String topicId)
31
+    {
32
+        return cmcTopicMapper.selectCmcTopicByTopicId(topicId);
33
+    }
34
+
35
+    /**
36
+     * 查询cmc聊天主题列表
37
+     * 
38
+     * @param cmcTopic cmc聊天主题
39
+     * @return cmc聊天主题
40
+     */
41
+    @Override
42
+    public List<CmcTopic> selectCmcTopicList(CmcTopic cmcTopic)
43
+    {
44
+        return cmcTopicMapper.selectCmcTopicList(cmcTopic);
45
+    }
46
+
47
+    /**
48
+     * 新增cmc聊天主题
49
+     * 
50
+     * @param cmcTopic cmc聊天主题
51
+     * @return 结果
52
+     */
53
+    @Override
54
+    public int insertCmcTopic(CmcTopic cmcTopic)
55
+    {
56
+        cmcTopic.setCreateTime(DateUtils.getNowDate());
57
+        return cmcTopicMapper.insertCmcTopic(cmcTopic);
58
+    }
59
+
60
+    /**
61
+     * 修改cmc聊天主题
62
+     * 
63
+     * @param cmcTopic cmc聊天主题
64
+     * @return 结果
65
+     */
66
+    @Override
67
+    public int updateCmcTopic(CmcTopic cmcTopic)
68
+    {
69
+        return cmcTopicMapper.updateCmcTopic(cmcTopic);
70
+    }
71
+
72
+    /**
73
+     * 批量删除cmc聊天主题
74
+     * 
75
+     * @param topicIds 需要删除的cmc聊天主题主键
76
+     * @return 结果
77
+     */
78
+    @Override
79
+    public int deleteCmcTopicByTopicIds(String[] topicIds)
80
+    {
81
+        return cmcTopicMapper.deleteCmcTopicByTopicIds(topicIds);
82
+    }
83
+
84
+    /**
85
+     * 删除cmc聊天主题信息
86
+     * 
87
+     * @param topicId cmc聊天主题主键
88
+     * @return 结果
89
+     */
90
+    @Override
91
+    public int deleteCmcTopicByTopicId(String topicId)
92
+    {
93
+        return cmcTopicMapper.deleteCmcTopicByTopicId(topicId);
94
+    }
95
+}

+ 83
- 0
llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcChatMapper.xml Voir le fichier

@@ -0,0 +1,83 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.CmcChatMapper">
6
+    
7
+    <resultMap type="CmcChat" id="CmcChatResult">
8
+        <result property="chatId"    column="chat_id"    />
9
+        <result property="topicId"    column="topic_id"    />
10
+        <result property="userId"    column="user_id"    />
11
+        <result property="input"    column="input"    />
12
+        <result property="inputTime"    column="input_time"    />
13
+        <result property="output"    column="output"    />
14
+        <result property="outputTime"    column="output_time"    />
15
+    </resultMap>
16
+
17
+    <sql id="selectCmcChatVo">
18
+        select chat_id, topic_id, user_id, input, input_time, output, output_time from cmc_chat
19
+    </sql>
20
+
21
+    <select id="selectCmcChatList" parameterType="CmcChat" resultMap="CmcChatResult">
22
+        <include refid="selectCmcChatVo"/>
23
+        <where>  
24
+            <if test="topicId != null  and topicId != ''"> and topic_id = #{topicId}</if>
25
+            <if test="userId != null "> and user_id = #{userId}</if>
26
+            <if test="input != null  and input != ''"> and input = #{input}</if>
27
+            <if test="inputTime != null "> and input_time = #{inputTime}</if>
28
+            <if test="output != null  and output != ''"> and output = #{output}</if>
29
+            <if test="outputTime != null "> and output_time = #{outputTime}</if>
30
+        </where>
31
+    </select>
32
+    
33
+    <select id="selectCmcChatByChatId" parameterType="String" resultMap="CmcChatResult">
34
+        <include refid="selectCmcChatVo"/>
35
+        where chat_id = #{chatId}
36
+    </select>
37
+
38
+    <insert id="insertCmcChat" parameterType="CmcChat">
39
+        insert into cmc_chat
40
+        <trim prefix="(" suffix=")" suffixOverrides=",">
41
+            <if test="chatId != null">chat_id,</if>
42
+            <if test="topicId != null">topic_id,</if>
43
+            <if test="userId != null">user_id,</if>
44
+            <if test="input != null">input,</if>
45
+            <if test="inputTime != null">input_time,</if>
46
+            <if test="output != null">output,</if>
47
+            <if test="outputTime != null">output_time,</if>
48
+         </trim>
49
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
50
+            <if test="chatId != null">#{chatId},</if>
51
+            <if test="topicId != null">#{topicId},</if>
52
+            <if test="userId != null">#{userId},</if>
53
+            <if test="input != null">#{input},</if>
54
+            <if test="inputTime != null">#{inputTime},</if>
55
+            <if test="output != null">#{output},</if>
56
+            <if test="outputTime != null">#{outputTime},</if>
57
+         </trim>
58
+    </insert>
59
+
60
+    <update id="updateCmcChat" parameterType="CmcChat">
61
+        update cmc_chat
62
+        <trim prefix="SET" suffixOverrides=",">
63
+            <if test="topicId != null">topic_id = #{topicId},</if>
64
+            <if test="userId != null">user_id = #{userId},</if>
65
+            <if test="input != null">input = #{input},</if>
66
+            <if test="inputTime != null">input_time = #{inputTime},</if>
67
+            <if test="output != null">output = #{output},</if>
68
+            <if test="outputTime != null">output_time = #{outputTime},</if>
69
+        </trim>
70
+        where chat_id = #{chatId}
71
+    </update>
72
+
73
+    <delete id="deleteCmcChatByChatId" parameterType="String">
74
+        delete from cmc_chat where chat_id = #{chatId}
75
+    </delete>
76
+
77
+    <delete id="deleteCmcChatByChatIds" parameterType="String">
78
+        delete from cmc_chat where chat_id in 
79
+        <foreach item="chatId" collection="array" open="(" separator="," close=")">
80
+            #{chatId}
81
+        </foreach>
82
+    </delete>
83
+</mapper>

+ 63
- 0
llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcDocumentMapper.xml Voir le fichier

@@ -0,0 +1,63 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.CmcDocumentMapper">
6
+    
7
+    <resultMap type="CmcDocument" id="CmcDocumentResult">
8
+        <result property="documentId"    column="document_id"    />
9
+        <result property="chatId"    column="chat_id"    />
10
+        <result property="path"    column="path"    />
11
+    </resultMap>
12
+
13
+    <sql id="selectCmcDocumentVo">
14
+        select document_id, chat_id, path from cmc_document
15
+    </sql>
16
+
17
+    <select id="selectCmcDocumentList" parameterType="CmcDocument" resultMap="CmcDocumentResult">
18
+        <include refid="selectCmcDocumentVo"/>
19
+        <where>  
20
+            <if test="chatId != null  and chatId != ''"> and chat_id = #{chatId}</if>
21
+            <if test="path != null  and path != ''"> and path = #{path}</if>
22
+        </where>
23
+    </select>
24
+    
25
+    <select id="selectCmcDocumentByDocumentId" parameterType="String" resultMap="CmcDocumentResult">
26
+        <include refid="selectCmcDocumentVo"/>
27
+        where document_id = #{documentId}
28
+    </select>
29
+
30
+    <insert id="insertCmcDocument" parameterType="CmcDocument">
31
+        insert into cmc_document
32
+        <trim prefix="(" suffix=")" suffixOverrides=",">
33
+            <if test="documentId != null">document_id,</if>
34
+            <if test="chatId != null">chat_id,</if>
35
+            <if test="path != null">path,</if>
36
+         </trim>
37
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
38
+            <if test="documentId != null">#{documentId},</if>
39
+            <if test="chatId != null">#{chatId},</if>
40
+            <if test="path != null">#{path},</if>
41
+         </trim>
42
+    </insert>
43
+
44
+    <update id="updateCmcDocument" parameterType="CmcDocument">
45
+        update cmc_document
46
+        <trim prefix="SET" suffixOverrides=",">
47
+            <if test="chatId != null">chat_id = #{chatId},</if>
48
+            <if test="path != null">path = #{path},</if>
49
+        </trim>
50
+        where document_id = #{documentId}
51
+    </update>
52
+
53
+    <delete id="deleteCmcDocumentByDocumentId" parameterType="String">
54
+        delete from cmc_document where document_id = #{documentId}
55
+    </delete>
56
+
57
+    <delete id="deleteCmcDocumentByDocumentIds" parameterType="String">
58
+        delete from cmc_document where document_id in 
59
+        <foreach item="documentId" collection="array" open="(" separator="," close=")">
60
+            #{documentId}
61
+        </foreach>
62
+    </delete>
63
+</mapper>

+ 62
- 0
llm-back/ruoyi-system/src/main/resources/mapper/llm/CmcTopicMapper.xml Voir le fichier

@@ -0,0 +1,62 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.CmcTopicMapper">
6
+    
7
+    <resultMap type="CmcTopic" id="CmcTopicResult">
8
+        <result property="topicId"    column="topic_id"    />
9
+        <result property="topic"    column="topic"    />
10
+        <result property="createTime"    column="create_time"    />
11
+    </resultMap>
12
+
13
+    <sql id="selectCmcTopicVo">
14
+        select topic_id, topic, create_time from cmc_topic
15
+    </sql>
16
+
17
+    <select id="selectCmcTopicList" parameterType="CmcTopic" resultMap="CmcTopicResult">
18
+        <include refid="selectCmcTopicVo"/>
19
+        <where>  
20
+            <if test="topic != null  and topic != ''"> and topic = #{topic}</if>
21
+        </where>
22
+    </select>
23
+    
24
+    <select id="selectCmcTopicByTopicId" parameterType="String" resultMap="CmcTopicResult">
25
+        <include refid="selectCmcTopicVo"/>
26
+        where topic_id = #{topicId}
27
+    </select>
28
+
29
+    <insert id="insertCmcTopic" parameterType="CmcTopic">
30
+        insert into cmc_topic
31
+        <trim prefix="(" suffix=")" suffixOverrides=",">
32
+            <if test="topicId != null">topic_id,</if>
33
+            <if test="topic != null">topic,</if>
34
+            <if test="createTime != null">create_time,</if>
35
+         </trim>
36
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
37
+            <if test="topicId != null">#{topicId},</if>
38
+            <if test="topic != null">#{topic},</if>
39
+            <if test="createTime != null">#{createTime},</if>
40
+         </trim>
41
+    </insert>
42
+
43
+    <update id="updateCmcTopic" parameterType="CmcTopic">
44
+        update cmc_topic
45
+        <trim prefix="SET" suffixOverrides=",">
46
+            <if test="topic != null">topic = #{topic},</if>
47
+            <if test="createTime != null">create_time = #{createTime},</if>
48
+        </trim>
49
+        where topic_id = #{topicId}
50
+    </update>
51
+
52
+    <delete id="deleteCmcTopicByTopicId" parameterType="String">
53
+        delete from cmc_topic where topic_id = #{topicId}
54
+    </delete>
55
+
56
+    <delete id="deleteCmcTopicByTopicIds" parameterType="String">
57
+        delete from cmc_topic where topic_id in 
58
+        <foreach item="topicId" collection="array" open="(" separator="," close=")">
59
+            #{topicId}
60
+        </foreach>
61
+    </delete>
62
+</mapper>

+ 52
- 3
llm-back/sql/ry_20240629.sql Voir le fichier

@@ -161,7 +161,7 @@ create table sys_menu (
161 161
 insert into sys_menu values('1', '系统管理', '0', '1', 'system',           null, '', '', 1, 0, 'M', '0', '0', '', 'system',   'admin', sysdate(), '', null, '系统管理目录');
162 162
 insert into sys_menu values('2', '系统监控', '0', '2', 'monitor',          null, '', '', 1, 0, 'M', '0', '0', '', 'monitor',  'admin', sysdate(), '', null, '系统监控目录');
163 163
 insert into sys_menu values('3', '系统工具', '0', '3', 'tool',             null, '', '', 1, 0, 'M', '0', '0', '', 'tool',     'admin', sysdate(), '', null, '系统工具目录');
164
-insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide',    'admin', sysdate(), '', null, '若依官网地址');
164
+insert into sys_menu values('4', '办公助手', '0', '4', 'chat',             null, '', '', 1, 0, 'M', '0', '0', '', 'wechat',   'admin', sysdate(), '', null, '办公助手目录');
165 165
 -- 二级菜单
166 166
 insert into sys_menu values('100',  '用户管理', '1',   '1', 'user',       'system/user/index',        '', '', 1, 0, 'C', '0', '0', 'system:user:list',        'user',          'admin', sysdate(), '', null, '用户管理菜单');
167 167
 insert into sys_menu values('101',  '角色管理', '1',   '2', 'role',       'system/role/index',        '', '', 1, 0, 'C', '0', '0', 'system:role:list',        'peoples',       'admin', sysdate(), '', null, '角色管理菜单');
@@ -547,7 +547,7 @@ create table sys_config (
547 547
 insert into sys_config values(1, '主框架页-默认皮肤样式名称',     'sys.index.skinName',            'skin-blue',     'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
548 548
 insert into sys_config values(2, '用户管理-账号初始密码',         'sys.user.initPassword',         '123456',        'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
549 549
 insert into sys_config values(3, '主框架页-侧边栏主题',           'sys.index.sideTheme',           'theme-dark',    'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
550
-insert into sys_config values(4, '账号自助-验证码开关',           'sys.account.captchaEnabled',    'true',          'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
550
+insert into sys_config values(4, '账号自助-验证码开关',           'sys.account.captchaEnabled',    'false',          'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
551 551
 insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser',      'false',         'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
552 552
 insert into sys_config values(6, '用户登录-黑名单列表',           'sys.login.blackIPList',         '',              'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)');
553 553
 
@@ -698,4 +698,53 @@ create table gen_table_column (
698 698
   update_by         varchar(64)     default ''                 comment '更新者',
699 699
   update_time       datetime                                   comment '更新时间',
700 700
   primary key (column_id)
701
-) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
701
+) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
702
+
703
+-- ----------------------------
704
+-- 20、聊天记录表字段
705
+-- ----------------------------
706
+DROP TABLE IF EXISTS `cmc_chat`;
707
+CREATE TABLE `cmc_chat`  (
708
+  `chat_id` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '聊天记录id',
709
+  `topic_id` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '聊天主题id',
710
+  `user_id` bigint NULL DEFAULT NULL COMMENT '用户id',
711
+  `input` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '输入',
712
+  `input_time` datetime NULL DEFAULT NULL COMMENT '输入时间',
713
+  `output` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '输出',
714
+  `output_time` datetime NULL DEFAULT NULL COMMENT '输出时间',
715
+  PRIMARY KEY (`chat_id`) USING BTREE
716
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 comment 'cmc聊天记录表';
717
+
718
+-- ----------------------------
719
+-- 初始化-聊天记录表数据
720
+-- ----------------------------
721
+
722
+-- ----------------------------
723
+-- 21、聊天附件表字段
724
+-- ----------------------------
725
+DROP TABLE IF EXISTS `cmc_document`;
726
+CREATE TABLE `cmc_document`  (
727
+  `document_id` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件id',
728
+  `chat_id` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '聊天记录id',
729
+  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件',
730
+  PRIMARY KEY (`document_id`) USING BTREE
731
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 comment 'cmc聊天附件表';
732
+
733
+-- ----------------------------
734
+-- 初始化-聊天附件表数据
735
+-- ----------------------------
736
+
737
+-- ----------------------------
738
+-- 22、聊天主题表字段
739
+-- ----------------------------
740
+DROP TABLE IF EXISTS `cmc_topic`;
741
+CREATE TABLE `cmc_topic`  (
742
+  `topic_id` char(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '聊天主题id',
743
+  `topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主题',
744
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
745
+  PRIMARY KEY (`topic_id`) USING BTREE
746
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 comment 'cmc聊天主题表';
747
+
748
+-- ----------------------------
749
+-- 初始化-聊天主题表数据
750
+-- ----------------------------

+ 2
- 2
llm-ui/.env.development Voir le fichier

@@ -1,8 +1,8 @@
1 1
 # 页面标题
2
-VITE_APP_TITLE = 若依管理系统
2
+VITE_APP_TITLE = CMC办公助手
3 3
 
4 4
 # 开发环境配置
5 5
 VITE_APP_ENV = 'development'
6 6
 
7
-# 若依管理系统/开发环境
7
+# CMC办公助手/开发环境
8 8
 VITE_APP_BASE_API = '/dev-api'

+ 2
- 2
llm-ui/.env.production Voir le fichier

@@ -1,10 +1,10 @@
1 1
 # 页面标题
2
-VITE_APP_TITLE = 若依管理系统
2
+VITE_APP_TITLE = CMC办公助手
3 3
 
4 4
 # 生产环境配置
5 5
 VITE_APP_ENV = 'production'
6 6
 
7
-# 若依管理系统/生产环境
7
+# CMC办公助手/生产环境
8 8
 VITE_APP_BASE_API = '/prod-api'
9 9
 
10 10
 # 是否在打包时开启压缩,支持 gzip 和 brotli

+ 2
- 2
llm-ui/.env.staging Voir le fichier

@@ -1,10 +1,10 @@
1 1
 # 页面标题
2
-VITE_APP_TITLE = 若依管理系统
2
+VITE_APP_TITLE = CMC办公助手
3 3
 
4 4
 # 生产环境配置
5 5
 VITE_APP_ENV = 'staging'
6 6
 
7
-# 若依管理系统/生产环境
7
+# CMC办公助手/生产环境
8 8
 VITE_APP_BASE_API = '/stage-api'
9 9
 
10 10
 # 是否在打包时开启压缩,支持 gzip 和 brotli

+ 1
- 1
llm-ui/index.html Voir le fichier

@@ -7,7 +7,7 @@
7 7
   <meta name="renderer" content="webkit">
8 8
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
9 9
   <link rel="icon" href="/favicon.ico">
10
-  <title>若依管理系统</title>
10
+  <title>CMC办公助手</title>
11 11
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
12 12
   <style>
13 13
     html,

+ 2
- 2
llm-ui/package.json Voir le fichier

@@ -1,8 +1,8 @@
1 1
 {
2 2
   "name": "ruoyi",
3 3
   "version": "3.8.9",
4
-  "description": "若依管理系统",
5
-  "author": "若依",
4
+  "description": "CMC办公助手",
5
+  "author": "CMC",
6 6
   "license": "MIT",
7 7
   "type": "module",
8 8
   "scripts": {

+ 50
- 0
llm-ui/src/api/llm/chat.js Voir le fichier

@@ -0,0 +1,50 @@
1
+/*
2
+ * @Author: wrh
3
+ * @Date: 2025-04-08 14:23:04
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2025-04-08 14:36:25
6
+ */
7
+import request from '@/utils/request'
8
+
9
+// 查询cmc聊天记录列表
10
+export function listChat(query) {
11
+  return request({
12
+    url: '/llm/chat/list',
13
+    method: 'get',
14
+    params: query
15
+  })
16
+}
17
+
18
+// 查询cmc聊天记录详细
19
+export function getChat(chatId) {
20
+  return request({
21
+    url: '/llm/chat/' + chatId,
22
+    method: 'get'
23
+  })
24
+}
25
+
26
+// 新增cmc聊天记录
27
+export function addChat(data) {
28
+  return request({
29
+    url: '/llm/chat',
30
+    method: 'post',
31
+    data: data
32
+  })
33
+}
34
+
35
+// 修改cmc聊天记录
36
+export function updateChat(data) {
37
+  return request({
38
+    url: '/llm/chat',
39
+    method: 'put',
40
+    data: data
41
+  })
42
+}
43
+
44
+// 删除cmc聊天记录
45
+export function delChat(chatId) {
46
+  return request({
47
+    url: '/llm/chat/' + chatId,
48
+    method: 'delete'
49
+  })
50
+}

+ 44
- 0
llm-ui/src/api/llm/document.js Voir le fichier

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询cmc聊天附件列表
4
+export function listDocument(query) {
5
+  return request({
6
+    url: '/system/document/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询cmc聊天附件详细
13
+export function getDocument(documentId) {
14
+  return request({
15
+    url: '/system/document/' + documentId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增cmc聊天附件
21
+export function addDocument(data) {
22
+  return request({
23
+    url: '/system/document',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改cmc聊天附件
30
+export function updateDocument(data) {
31
+  return request({
32
+    url: '/system/document',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除cmc聊天附件
39
+export function delDocument(documentId) {
40
+  return request({
41
+    url: '/system/document/' + documentId,
42
+    method: 'delete'
43
+  })
44
+}

+ 44
- 0
llm-ui/src/api/llm/topic.js Voir le fichier

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询cmc聊天主题列表
4
+export function listTopic(query) {
5
+  return request({
6
+    url: '/system/topic/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询cmc聊天主题详细
13
+export function getTopic(topicId) {
14
+  return request({
15
+    url: '/system/topic/' + topicId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增cmc聊天主题
21
+export function addTopic(data) {
22
+  return request({
23
+    url: '/system/topic',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改cmc聊天主题
30
+export function updateTopic(data) {
31
+  return request({
32
+    url: '/system/topic',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除cmc聊天主题
39
+export function delTopic(topicId) {
40
+  return request({
41
+    url: '/system/topic/' + topicId,
42
+    method: 'delete'
43
+  })
44
+}

+ 4
- 3
llm-ui/src/layout/components/Navbar.vue Voir le fichier

@@ -5,7 +5,7 @@
5 5
     <top-nav id="topmenu-container" class="topmenu-container" v-if="settingsStore.topNav" />
6 6
 
7 7
     <div class="right-menu">
8
-      <template v-if="appStore.device !== 'mobile'">
8
+      <!-- <template v-if="appStore.device !== 'mobile'">
9 9
         <header-search id="header-search" class="right-menu-item" />
10 10
 
11 11
         <el-tooltip content="源码地址" effect="dark" placement="bottom">
@@ -28,8 +28,9 @@
28 28
         <el-tooltip content="布局大小" effect="dark" placement="bottom">
29 29
           <size-select id="size-select" class="right-menu-item hover-effect" />
30 30
         </el-tooltip>
31
-      </template>
31
+      </template> -->
32 32
       <div class="avatar-container">
33
+        <span class="right-menu-item">当前用户:{{ userStore.name }}</span>
33 34
         <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
34 35
           <div class="avatar-wrapper">
35 36
             <img :src="userStore.avatar" class="user-avatar" />
@@ -160,7 +161,7 @@ function toggleTheme() {
160 161
       display: inline-block;
161 162
       padding: 0 8px;
162 163
       height: 100%;
163
-      font-size: 18px;
164
+      font-size: 14px;
164 165
       color: var(--navbar-text);
165 166
       vertical-align: text-bottom;
166 167
 

+ 5
- 0
llm-ui/src/router/index.js Voir le fichier

@@ -83,6 +83,11 @@ export const constantRoutes = [
83 83
         meta: { title: '个人中心', icon: 'user' }
84 84
       }
85 85
     ]
86
+  },
87
+  {
88
+    path: '/chat',
89
+    component: () => import('@/views/chat'),
90
+    hidden: true
86 91
   }
87 92
 ]
88 93
 

+ 185
- 0
llm-ui/src/views/chat.vue Voir le fichier

@@ -0,0 +1,185 @@
1
+<!--
2
+ * @Author: wrh
3
+ * @Date: 2025-04-07 14:14:05
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2025-04-07 18:00:58
6
+-->
7
+<template>
8
+  <!-- 最外层页面于窗口同宽,使聊天面板居中 -->
9
+  <div class="home-view">
10
+    <!-- 整个聊天面板 -->
11
+    <div class="chat-panel">
12
+      <!-- 左侧的会话列表 -->
13
+      <div class="session-panel">
14
+        <div class="title">办公助手</div>
15
+        <div class="description">构建你的AI助手</div>
16
+      </div>
17
+      <!-- 右侧的消息记录 -->
18
+
19
+      <div class="message-panel">
20
+        <div class="navbar">
21
+          <div class="right-menu">
22
+            <div class="avatar-container">
23
+              <span class="right-menu-item">当前用户:{{ userStore.name }}</span>
24
+              <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
25
+                <div class="avatar-wrapper">
26
+                  <img :src="userStore.avatar" class="user-avatar" />
27
+                  <el-icon><caret-bottom /></el-icon>
28
+                </div>
29
+                <template #dropdown>
30
+                  <el-dropdown-menu>
31
+                    <router-link to="/user/profile">
32
+                      <el-dropdown-item>个人中心</el-dropdown-item>
33
+                    </router-link>
34
+                    <el-dropdown-item divided command="logout">
35
+                      <span>退出登录</span>
36
+                    </el-dropdown-item>
37
+                  </el-dropdown-menu>
38
+                </template>
39
+              </el-dropdown>
40
+            </div>
41
+          </div>
42
+        </div>
43
+      </div>
44
+    </div>
45
+  </div>
46
+</template>
47
+
48
+<script setup name=''>
49
+import { reactive, toRefs, onBeforeMount, onMounted } from 'vue'
50
+import useUserStore from '@/store/modules/user'
51
+import useSettingsStore from '@/store/modules/settings'
52
+const userStore = useUserStore()
53
+const settingsStore = useSettingsStore()
54
+function handleCommand(command) {
55
+  switch (command) {
56
+    case "logout":
57
+      logout();
58
+      break;
59
+    default:
60
+      break;
61
+  }
62
+}
63
+
64
+function logout() {
65
+  ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
66
+    confirmButtonText: '确定',
67
+    cancelButtonText: '取消',
68
+    type: 'warning'
69
+  }).then(() => {
70
+    userStore.logOut().then(() => {
71
+      location.href = '/index';
72
+    })
73
+  }).catch(() => { });
74
+}
75
+
76
+</script>
77
+<style lang="scss" scoped>
78
+.home-view {
79
+  display: flex;
80
+  /* 与窗口同宽 */
81
+  width: 100vw;
82
+  /* 水平方向上剧中 */
83
+  justify-content: center;
84
+
85
+  .chat-panel {
86
+    /* 聊天面板flex布局,让会话列表和聊天记录左右展示 */
87
+    display: flex;
88
+    /* 让聊天面板圆润一些 */
89
+    border-radius: 20px;
90
+    background-color: white;
91
+    /* 给一些阴影 */
92
+    box-shadow: 0 0 20px 20px rgba(black, 0.05);
93
+    /* 与上方增加一些间距 */
94
+    margin-top: 70px;
95
+
96
+    /* 左侧聊天会话面板*/
97
+    .session-panel {
98
+      background-color: rgb(231, 248, 255);
99
+      width: 300px;
100
+      border-top-left-radius: 20px;
101
+      border-bottom-left-radius: 20px;
102
+      padding: 20px;
103
+      position: relative;
104
+      border-right: 1px solid rgba(black, 0.07);
105
+
106
+      /* 标题*/
107
+      .title {
108
+        margin-top: 20px;
109
+        font-size: 20px;
110
+      }
111
+
112
+      /* 描述*/
113
+      .description {
114
+        color: rgba(black, 0.7);
115
+        font-size: 10px;
116
+        margin-top: 10px;
117
+      }
118
+    }
119
+
120
+    /* 右侧消息记录面板*/
121
+    .message-panel {
122
+      width: 700px;
123
+      height: 800px;
124
+    }
125
+  }
126
+
127
+}
128
+
129
+.navbar {
130
+  height: 50px;
131
+  overflow: hidden;
132
+  position: relative;
133
+  background: var(--navbar-bg);
134
+  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
135
+
136
+  .right-menu {
137
+    float: right;
138
+    height: 100%;
139
+    line-height: 50px;
140
+    display: flex;
141
+
142
+    .right-menu-item {
143
+      display: inline-block;
144
+      padding: 0 8px;
145
+      height: 100%;
146
+      font-size: 14px;
147
+      color: var(--navbar-text);
148
+      vertical-align: text-bottom;
149
+
150
+      &.hover-effect {
151
+        cursor: pointer;
152
+        transition: background 0.3s;
153
+
154
+        &:hover {
155
+          background: rgba(0, 0, 0, 0.025);
156
+        }
157
+      }
158
+
159
+      .avatar-container {
160
+        margin-right: 30px;
161
+
162
+        .avatar-wrapper {
163
+          margin-top: 5px;
164
+          position: relative;
165
+
166
+          .user-avatar {
167
+            cursor: pointer;
168
+            width: 40px;
169
+            height: 40px;
170
+            border-radius: 10px;
171
+          }
172
+
173
+          i {
174
+            cursor: pointer;
175
+            position: absolute;
176
+            right: -20px;
177
+            top: 25px;
178
+            font-size: 12px;
179
+          }
180
+        }
181
+      }
182
+    }
183
+  }
184
+}
185
+</style>

+ 2
- 2
llm-ui/src/views/login.vue Voir le fichier

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="login">
3 3
     <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
4
-      <h3 class="title">若依后台管理系统</h3>
4
+      <h3 class="title">CMC办公助手</h3>
5 5
       <el-form-item prop="username">
6 6
         <el-input
7 7
           v-model="loginForm.username"
@@ -59,7 +59,7 @@
59 59
     </el-form>
60 60
     <!--  底部  -->
61 61
     <div class="el-login-footer">
62
-      <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
62
+      <span>Copyright © 2025 四川中水成勘院测绘工程有限责任公司 All Rights Reserved.</span>
63 63
     </div>
64 64
   </div>
65 65
 </template>

+ 7
- 1
llm-ui/vite.config.js Voir le fichier

@@ -1,3 +1,9 @@
1
+/*
2
+ * @Author: wrh
3
+ * @Date: 2025-04-07 12:47:46
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2025-04-08 09:02:00
6
+ */
1 7
 import { defineConfig, loadEnv } from 'vite'
2 8
 import path from 'path'
3 9
 import createVitePlugins from './vite/plugins'
@@ -25,7 +31,7 @@ export default defineConfig(({ mode, command }) => {
25 31
     },
26 32
     // vite 相关配置
27 33
     server: {
28
-      port: 80,
34
+      port: 81,
29 35
       host: true,
30 36
       open: true,
31 37
       proxy: {

Loading…
Annuler
Enregistrer