重构 jeesite-ai 代码目录,新增 parent-ai,重命名 cms-ai 为 ai-cms
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<suspend_validator>false</suspend_validator>
|
||||
<export_setting>
|
||||
<export_ddl_setting>
|
||||
<output_path>db/cms-ai.sql</output_path>
|
||||
<output_path>db/ai-cms.sql</output_path>
|
||||
<encoding>UTF-8</encoding>
|
||||
<line_feed>CR+LF</line_feed>
|
||||
<is_open_after_saved>false</is_open_after_saved>
|
||||
@@ -73,7 +73,7 @@
|
||||
</export_ddl_setting>
|
||||
<export_excel_setting>
|
||||
<category_id>null</category_id>
|
||||
<output_path>db/cms-ai.xls</output_path>
|
||||
<output_path>db/ai-cms.xls</output_path>
|
||||
<template></template>
|
||||
<template_path></template_path>
|
||||
<used_default_template_lang>en</used_default_template_lang>
|
||||
@@ -89,7 +89,7 @@
|
||||
<is_open_after_saved>true</is_open_after_saved>
|
||||
</export_html_setting>
|
||||
<export_image_setting>
|
||||
<output_file_path>db/cms-ai.png</output_file_path>
|
||||
<output_file_path>db/ai-cms.png</output_file_path>
|
||||
<category_dir_path></category_dir_path>
|
||||
<with_category_image>true</with_category_image>
|
||||
<is_open_after_saved>true</is_open_after_saved>
|
||||
@@ -5,24 +5,22 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<artifactId>jeesite-parent-ai</artifactId>
|
||||
<version>5.14.0.springboot3-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
<relativePath>../../../parent/ai/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-module-cms-ai</artifactId>
|
||||
<artifactId>jeesite-module-ai-cms</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>JeeSite Module CMS+RAG+AI</name>
|
||||
<name>JeeSite Module AI + CMS + RAG</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
<spring-ai.version>1.0.3</spring-ai.version>
|
||||
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 核心模块 --><!--suppress VulnerableLibrariesLocal -->
|
||||
@@ -39,7 +37,7 @@
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 在线大模型 -->
|
||||
<!-- 云端模型 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
@@ -119,20 +117,21 @@
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.27.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bom</artifactId>
|
||||
<version>${spring-ai.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<!-- Ai Tools -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-ai-tools</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MCP Client -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-mcp-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.ai.config;
|
||||
package com.jeesite.modules.ai.cms.config;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Configuration
|
||||
public class CmsAiWebMvcConfig implements WebMvcConfigurer {
|
||||
public class AiCmsWebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.ai.service;
|
||||
package com.jeesite.modules.ai.cms.service;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.ai.service;
|
||||
package com.jeesite.modules.ai.cms.service;
|
||||
|
||||
import com.jeesite.common.cache.CacheUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -2,11 +2,11 @@
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.ai.web;
|
||||
package com.jeesite.modules.ai.cms.web;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.cms.ai.service.CmsAiChatService;
|
||||
import com.jeesite.modules.ai.cms.service.AiCmsChatService;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.ai.chat.messages.Message;
|
||||
@@ -31,10 +31,10 @@ import java.util.stream.Collectors;
|
||||
@RequestMapping("${adminPath}/cms/chat")
|
||||
public class CmsAiChatController extends BaseController {
|
||||
|
||||
private final CmsAiChatService cmsAiChatService;
|
||||
private final AiCmsChatService aiCmsChatService;
|
||||
|
||||
public CmsAiChatController(CmsAiChatService cmsAiChatService) {
|
||||
this.cmsAiChatService = cmsAiChatService;
|
||||
public CmsAiChatController(AiCmsChatService aiCmsChatService) {
|
||||
this.aiCmsChatService = aiCmsChatService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/message")
|
||||
public List<Message> message(String id) {
|
||||
return cmsAiChatService.getChatMessage(id);
|
||||
return aiCmsChatService.getChatMessage(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public Collection<Map<String, Object>> list() {
|
||||
return cmsAiChatService.getChatCacheMap().values().stream()
|
||||
return aiCmsChatService.getChatCacheMap().values().stream()
|
||||
.sorted(Comparator.comparing(map -> (String) map.get("id"),
|
||||
Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public String save(String id, String title) {
|
||||
Map<String, Object> map = cmsAiChatService.saveChatConversation(id, title);
|
||||
Map<String, Object> map = aiCmsChatService.saveChatConversation(id, title);
|
||||
return renderResult(Global.TRUE, "保存成功", map);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public String delete(@RequestParam String id) {
|
||||
cmsAiChatService.deleteChatConversation(id);
|
||||
aiCmsChatService.deleteChatConversation(id);
|
||||
return renderResult(Global.TRUE, "删除成功", id);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public Flux<ChatResponse> stream(@RequestParam String id, @RequestParam String message, HttpServletRequest request) {
|
||||
return cmsAiChatService.chatStream(id, message, request);
|
||||
return aiCmsChatService.chatStream(id, message, request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/text")
|
||||
public String text(@RequestParam String message) {
|
||||
return cmsAiChatService.chatText(message);
|
||||
return aiCmsChatService.chatText(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/json")
|
||||
public Map<String, Object> json(@RequestParam String message) {
|
||||
return cmsAiChatService.chatJson(message);
|
||||
return aiCmsChatService.chatJson(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ public class CmsAiChatController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/entity")
|
||||
public List<Area> entity(@RequestParam String message) {
|
||||
return cmsAiChatService.chatArea(message);
|
||||
return aiCmsChatService.chatArea(message);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
## 重要提示(Tip):
|
||||
|
||||
## 请勿在该配置文件中添加其它任何配置(添加也不会生效)。
|
||||
## 该文件,仅仅是为了让 jeesite-cms-ai.yml 文件,
|
||||
## 该文件,仅仅是为了让 jeesite-ai-cms.yml 文件,
|
||||
## 在 IDEA 中有一个自动完成及帮助提示,并无其它用意。
|
||||
## 参数配置请在 jeesite-cms-ai.yml 文件中添加。
|
||||
## 参数配置请在 jeesite-ai-cms.yml 文件中添加。
|
||||
|
||||
spring:
|
||||
config:
|
||||
import:
|
||||
- classpath:config/jeesite-cms-ai.yml
|
||||
- classpath:config/jeesite-ai-cms.yml
|
||||
@@ -0,0 +1,5 @@
|
||||
5.11.1
|
||||
5.12.0
|
||||
5.12.1
|
||||
5.13.0
|
||||
5.13.1
|
||||
40
modules/ai/pom.xml
Normal file
40
modules/ai/pom.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent-ai</artifactId>
|
||||
<version>5.14.0.springboot3-SNAPSHOT</version>
|
||||
<relativePath>../../parent/ai/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>jeesite-module-ai</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Module AI</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<modules>
|
||||
<module>ai-cms</module>
|
||||
<module>ai-tools</module>
|
||||
</modules>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
</project>
|
||||
@@ -1 +0,0 @@
|
||||
5.11.0
|
||||
Reference in New Issue
Block a user