新增 AI MCP 服务端和客户端调用,展示远程工具调用示例
This commit is contained in:
@@ -2,16 +2,18 @@
|
||||
* 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.datasource.DataSourceHolder;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.modules.cms.ai.properties.CmsAiProperties;
|
||||
import com.jeesite.modules.cms.ai.service.CacheChatMemoryRepository;
|
||||
import com.jeesite.modules.cms.ai.tools.CmsAiTools;
|
||||
import com.jeesite.modules.ai.cms.properties.AiCmsProperties;
|
||||
import com.jeesite.modules.ai.cms.service.CacheChatMemoryRepository;
|
||||
import com.jeesite.modules.ai.tools.TestAiTools;
|
||||
import com.jeesite.modules.ai.tools.UserAITools;
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.ai.chat.memory.ChatMemory;
|
||||
import org.springframework.ai.chat.memory.MessageWindowChatMemory;
|
||||
import org.springframework.ai.mcp.SyncMcpToolCallbackProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -24,24 +26,41 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(CmsAiProperties.class)
|
||||
public class CmsAiChatConfig {
|
||||
@EnableConfigurationProperties(AiCmsProperties.class)
|
||||
public class AiCmsChatConfig {
|
||||
|
||||
/**
|
||||
* 聊天对话客户端
|
||||
* 聊天对话客户端(使用本地 Tools)
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Bean
|
||||
public ChatClient chatClient(ChatClient.Builder builder, CmsAiProperties properties) {
|
||||
@Bean("chatClient")
|
||||
@ConditionalOnProperty(name = "spring.ai.mcp.client.enabled", havingValue = "false", matchIfMissing = true)
|
||||
public ChatClient chatClient(ChatClient.Builder builder, AiCmsProperties properties,
|
||||
TestAiTools testAiTools, UserAITools userAITools) {
|
||||
if (StringUtils.isNotBlank(properties.getDefaultSystem())) {
|
||||
builder.defaultSystem(properties.getDefaultSystem());
|
||||
}
|
||||
if (properties.getToolCalls()) {
|
||||
builder.defaultTools(new CmsAiTools());
|
||||
if (properties.getTools().getEnabled()) {
|
||||
builder.defaultTools(testAiTools, userAITools);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天对话客户端(使用 MCP Tools)
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Bean("chatClient")
|
||||
@ConditionalOnProperty(name = "spring.ai.mcp.client.enabled", havingValue = "true", matchIfMissing = false)
|
||||
public ChatClient chatClientMcp(ChatClient.Builder builder, AiCmsProperties properties,
|
||||
SyncMcpToolCallbackProvider syncMcpToolCallbackProvider) {
|
||||
if (StringUtils.isNotBlank(properties.getDefaultSystem())) {
|
||||
builder.defaultSystem(properties.getDefaultSystem());
|
||||
}
|
||||
builder.defaultToolCallbacks(syncMcpToolCallbackProvider.getToolCallbacks());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天对话数据存储
|
||||
* @author ThinkGem
|
||||
@@ -7,10 +7,16 @@ spring:
|
||||
model:
|
||||
chat: openai
|
||||
embedding: ${spring.ai.model.chat}
|
||||
image: ${spring.ai.model.chat}
|
||||
audio: ${spring.ai.model.chat}
|
||||
embedding.text: ${spring.ai.model.chat}
|
||||
embedding.multimodal: ${spring.ai.model.chat}
|
||||
audio.transcription: none
|
||||
audio.speech: none
|
||||
moderation: none
|
||||
image: none
|
||||
|
||||
# 在线大模型【请在 pom.xml 中打开 openai 的注释,并注释上其它模型】
|
||||
# ========= 聊天对话 相关配置 =========
|
||||
|
||||
# 云端模型【请在 pom.xml 中打开 openai 的注释,并注释上其它模型】
|
||||
openai:
|
||||
|
||||
# 聊天对话模型使用阿里百炼
|
||||
@@ -88,7 +94,7 @@ spring:
|
||||
# 聊天对话模型
|
||||
chat:
|
||||
options:
|
||||
model: qwen2.5
|
||||
model: qwen3:8b
|
||||
#model: deepseek-r1:7b
|
||||
max-tokens: 1024
|
||||
temperature: 0.6
|
||||
@@ -98,11 +104,11 @@ spring:
|
||||
embedding:
|
||||
# 维度 dimensions 设置为 384
|
||||
#model: all-minilm:33m
|
||||
# 维度 dimensions 设置为 768
|
||||
#model: nomic-embed-text
|
||||
# 维度 dimensions 设置为 1024
|
||||
model: bge-m3
|
||||
|
||||
# ========= 向量数据库 相关配置 =========
|
||||
|
||||
# 向量数据库配置
|
||||
vectorstore:
|
||||
|
||||
@@ -153,8 +159,31 @@ spring:
|
||||
index-type: HNSW
|
||||
metric-type: COSINE
|
||||
|
||||
# 是否启用工具调用【例子详见 CmsAiTools.java 】
|
||||
tool-calls: false
|
||||
# ========= 本地工具调用 相关配置 =========
|
||||
|
||||
# 是否启用 Tool calling 工具调用【例子详见 TestAiTools.java、UserAiTools.java 】
|
||||
tools:
|
||||
enabled: false
|
||||
|
||||
# ========= MPC 远程工具调用 相关配置 =========
|
||||
|
||||
# https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html
|
||||
mcp:
|
||||
client:
|
||||
enabled: false
|
||||
name: jeesite-mcp-client
|
||||
version: 1.0.0
|
||||
request-timeout: 30s
|
||||
type: SYNC
|
||||
sse:
|
||||
connections:
|
||||
jeesite:
|
||||
url: http://127.0.0.1:8981
|
||||
sse-endpoint: /api/v1/sse
|
||||
toolcallback:
|
||||
enabled: true
|
||||
|
||||
# ========= 默认提示词、默认回答模版 =========
|
||||
|
||||
# 默认系统提示词
|
||||
default-system: |
|
||||
@@ -167,7 +196,6 @@ spring:
|
||||
请根据知识库和提供的历史信息作答。如果知识库中没有答案,请自我发挥。
|
||||
以下是知识库信息:{question_answer_context}
|
||||
|
||||
|
||||
# ========= Postgresql 向量数据库数据源 =========
|
||||
|
||||
#jdbc:
|
||||
@@ -192,6 +220,8 @@ spring:
|
||||
# username: elastic
|
||||
# password: elastic
|
||||
|
||||
# ========= 其他配置选项 =========
|
||||
|
||||
# 对话消息存缓存,可自定义存数据库
|
||||
j2cache:
|
||||
caffeine:
|
||||
@@ -199,7 +229,3 @@ j2cache:
|
||||
# 对话消息的超期时间,默认 30天,根据需要可以设置更久。
|
||||
cmsChatCache: 100000, 30d
|
||||
cmsChatMsgCache: 100000, 30d
|
||||
|
||||
#logging:
|
||||
# level:
|
||||
# org.springframework: debug
|
||||
@@ -23,7 +23,7 @@ public class TestAiTools {
|
||||
/**
|
||||
* 获取服务器时间
|
||||
*/
|
||||
@Tool(name="获取服务器时间", description = "获取当前的日期和时间,格式为 yyyy-MM-dd HH:mm:ss。")
|
||||
@Tool(name="当前服务器时间", description = "当前服务器日期时间,格式为 yyyy-MM-dd HH:mm:ss。")
|
||||
public String getCurrentDateTime() {
|
||||
String dateTime = "当前日期时间:" + DateUtils.getDateTime();
|
||||
logger.info("当前日期时间 ============== {}", dateTime);
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>ai</module>
|
||||
<module>app</module>
|
||||
<module>cms</module>
|
||||
<module>cms-ai</module>
|
||||
<module>core</module>
|
||||
<module>static</module>
|
||||
<module>test</module>
|
||||
</modules>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
<modules>
|
||||
<module>../parent</module>
|
||||
<module>../parent/ai</module>
|
||||
<module>../common</module>
|
||||
<module>../modules</module>
|
||||
<module>../web</module>
|
||||
|
||||
13
web-ai/web-ai-mcp/README.md
Normal file
13
web-ai/web-ai-mcp/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
## 介绍
|
||||
|
||||
jeesite-web-ai-mcp 是一个 JeeSite 模型上下文协议(Model Context Protocol,MCP)服务端
|
||||
|
||||
可提供外部 AI 大模型调用,语义化调用 JeeSite 服务数据,如:查询张三用户信息
|
||||
|
||||
## 文档
|
||||
|
||||
部署文档:http://jeesite.com/docs/install-deploy/
|
||||
|
||||
常见问题:http://jeesite.com/docs/faq/
|
||||
|
||||
更多文档:http://jeesite.com/docs
|
||||
19
web-ai/web-ai-mcp/bin/docker-build.bat
Normal file
19
web-ai/web-ai-mcp/bin/docker-build.bat
Normal file
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>Docker<65><72><EFBFBD><EFBFBD>
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean package docker:remove docker:build -Dmaven.test.skip=true -U
|
||||
|
||||
cd bin
|
||||
pause
|
||||
16
web-ai/web-ai-mcp/bin/docker-build.sh
Normal file
16
web-ai/web-ai-mcp/bin/docker-build.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# *
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 打包Web工程,编译Docker镜像。"
|
||||
echo ""
|
||||
|
||||
cd ..
|
||||
mvn clean package docker:remove docker:build -Dmaven.test.skip=true -U
|
||||
|
||||
cd bin
|
||||
22
web-ai/web-ai-mcp/bin/docker/Dockerfile
Normal file
22
web-ai/web-ai-mcp/bin/docker/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM docker.m.daocloud.io/openjdk:17
|
||||
LABEL maintainer="ThinkGem@163.com"
|
||||
ENV TZ "Asia/Shanghai"
|
||||
ENV LANG C.UTF-8
|
||||
VOLUME /tmp
|
||||
VOLUME /data
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
#RUN mkdir WEB-INF
|
||||
#ADD jeesite.lic ./WEB-INF
|
||||
ADD ./maven/web.war ./app.war
|
||||
|
||||
#ENV JAVA_OPTS "$JAVA_OPTS -Xms256m -Xmx1024m"
|
||||
ENV JAVA_OPTS "$JAVA_OPTS -Dspring.profiles.active=prod"
|
||||
|
||||
ENTRYPOINT if [ -f "app.war" ]; then jar -xvf app.war && rm app.war; \
|
||||
fi && cd WEB-INF && sh startup.sh && cd WEB-INF && sh startup.sh
|
||||
|
||||
EXPOSE 8980
|
||||
|
||||
#docker run -p 8980:8980 thinkgem/jeesite-web:5.10
|
||||
34
web-ai/web-ai-mcp/bin/init-data.bat
Normal file
34
web-ai/web-ai-mcp/bin/init-data.bat
Normal file
@@ -0,0 +1,34 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ⡣
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>״ΰ<D7B4>װ JeeSite <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ Module <20><><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>Ѱ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ԡ<EFBFBD>
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20>ٷ<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD>ṩ<EFBFBD>ij<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ<DDBF><E2B9A4><EFBFBD>DZȽϰ<C8BD>ȫ<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>û<EFBFBD>а<EFBFBD><D0B0><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĽű<C4BD><C5B1><EFBFBD>
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ð汾<C3B0><E6B1BE><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD><C5B3><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>ٲ<EFBFBD><D9B2><EFBFBD><EFBFBD><EFBFBD>
|
||||
echo.
|
||||
pause
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
|
||||
call mvn clean compile -Dmaven.test.skip=true -U
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>濪ʼ<E6BFAA><CABC>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ⡣
|
||||
echo.
|
||||
pause
|
||||
|
||||
set "MAVEN_OPTS=%MAVEN_OPTS% -Xms512m -Xmx1024m"
|
||||
call mvn test -Dmaven.test.skip=false -Dtest=com.jeesite.test.InitData
|
||||
|
||||
cd bin
|
||||
pause
|
||||
35
web-ai/web-ai-mcp/bin/init-data.sh
Normal file
35
web-ai/web-ai-mcp/bin/init-data.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# *
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 初始化数据库。"
|
||||
echo ""
|
||||
echo "[信息] 本操作主要用于首次安装 JeeSite 或后安装 Module 的数据表初始化,若模块已安装会自动忽略。"
|
||||
echo ""
|
||||
echo "[信息] 官方默认提供的初始化数据库工具是比较安全的,她没有包含删除您的业务数据表及数据的脚本。"
|
||||
echo ""
|
||||
echo "[信息] 如果你是升级到该版本,不排除你是否升级完整,为安全起见,建议先备份数据库后再操作。"
|
||||
echo ""
|
||||
echo "请按回车键继续 ... "
|
||||
read text
|
||||
|
||||
cd ..
|
||||
|
||||
mvn clean compile -Dmaven.test.skip=true -U
|
||||
echo ""
|
||||
echo "[信息] 依赖下载完成,下面开始初始化数据库。"
|
||||
echo ""
|
||||
echo "请按回车键继续 ... "
|
||||
read text
|
||||
|
||||
MAVEN_OPTS="$MAVEN_OPTS -Xms512m -Xmx1024m"
|
||||
mvn test -Dmaven.test.skip=false -Dtest=com.jeesite.test.InitData
|
||||
|
||||
cd bin
|
||||
echo "请按回车键完成 ... "
|
||||
read text
|
||||
22
web-ai/web-ai-mcp/bin/package.bat
Normal file
22
web-ai/web-ai-mcp/bin/package.bat
Normal file
@@ -0,0 +1,22 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>war/jar<61><72><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
call mvn -v
|
||||
echo.
|
||||
|
||||
cd ..
|
||||
call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||
|
||||
cd bin
|
||||
pause
|
||||
18
web-ai/web-ai-mcp/bin/package.sh
Normal file
18
web-ai/web-ai-mcp/bin/package.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 打包Web工程,生成war/jar包文件。"
|
||||
echo ""
|
||||
|
||||
mvn -v
|
||||
echo ""
|
||||
|
||||
cd ..
|
||||
mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||
|
||||
cd bin
|
||||
20
web-ai/web-ai-mcp/bin/run-tomcat.bat
Normal file
20
web-ai/web-ai-mcp/bin/run-tomcat.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] ʹ<><CAB9> Spring Boot Tomcat <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
title %cd%
|
||||
set "MAVEN_OPTS=%MAVEN_OPTS% -Xms512m -Xmx1024m"
|
||||
call mvn clean spring-boot:run -Dmaven.test.skip=true
|
||||
|
||||
pause
|
||||
15
web-ai/web-ai-mcp/bin/run-tomcat.sh
Normal file
15
web-ai/web-ai-mcp/bin/run-tomcat.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# *
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 使用 Spring Boot Tomcat 运行 Web 工程。"
|
||||
echo ""
|
||||
|
||||
cd ..
|
||||
MAVEN_OPTS="$MAVEN_OPTS -Xms512m -Xmx1024m"
|
||||
mvn clean spring-boot:run -Dmaven.test.skip=true
|
||||
31
web-ai/web-ai-mcp/bin/run-web.bat
Normal file
31
web-ai/web-ai-mcp/bin/run-web.bat
Normal file
@@ -0,0 +1,31 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
rem <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD>ʼ<EFBFBD><CABC>
|
||||
cd ..
|
||||
call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||
cd target
|
||||
rem <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
rem web.war <20><> pom.xml <20><> finalName<6D><65>packaging һ<><D2BB>
|
||||
mkdir app
|
||||
copy web.war app
|
||||
cd app
|
||||
jar -xvf web.war
|
||||
del web.war
|
||||
cd WEB-INF
|
||||
call startup.bat
|
||||
|
||||
pause
|
||||
27
web-ai/web-ai-mcp/bin/run-web.sh
Normal file
27
web-ai/web-ai-mcp/bin/run-web.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# *
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 打包Web工程,并运行Web工程。"
|
||||
echo ""
|
||||
|
||||
# 打包Web工程(开始)
|
||||
cd ..
|
||||
mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||
cd target
|
||||
# 打包Web工程(结束)
|
||||
|
||||
|
||||
# web.war 与 pom.xml 中 finalName、packaging 一致
|
||||
mkdir app
|
||||
cp web.war ./app
|
||||
cd app
|
||||
jar -xvf web.war
|
||||
rm web.war
|
||||
cd WEB-INF
|
||||
sh ./startup.sh
|
||||
138
web-ai/web-ai-mcp/pom.xml
Normal file
138
web-ai/web-ai-mcp/pom.xml
Normal file
@@ -0,0 +1,138 @@
|
||||
<?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-web-ai-mcp</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<description>Web AI MCP 服务</description>
|
||||
|
||||
<name>JeeSite Web</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
<finalName>web</finalName><!-- war 或 jar 包的名称 -->
|
||||
<start-class>com.jeesite.modules.AiMcpApplication</start-class>
|
||||
|
||||
<!-- docker setting -->
|
||||
<docker.run.port>8980:8980</docker.run.port>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 核心模块 --><!--suppress VulnerableLibrariesLocal -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Ai Tools -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-ai-tools</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MCP Server -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 热部署工具
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency> -->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${finalName}</finalName>
|
||||
<!--<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>-->
|
||||
<plugins>
|
||||
|
||||
<!-- Spring Boot -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- war插件,war包名称不带版本号 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<warName>${finalName}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Eclipse 插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<configuration>
|
||||
<wtpContextName>${finalName}</wtpContextName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<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>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-repos</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jeesite-repos</id>
|
||||
<url>https://maven.jeesite.net/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>aliyun-repos</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>jeesite-repos</id>
|
||||
<url>https://maven.jeesite.net/repository/maven-public</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.io.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* Application
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class AiMcpApplication extends SpringBootServletInitializer {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AiMcpApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AiMcpApplication.class, args);
|
||||
logger.info(
|
||||
"\n\n==============================================================\n"
|
||||
+ "\n 启动完成,MCP 地址:http://127.0.0.1:{}/api/v1/sse\n"
|
||||
+ "\n==============================================================\n",
|
||||
Global.getProperty("server.port") + FileUtils.path(
|
||||
Global.getProperty("server.servlet.context-path")));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
this.setRegisterErrorPageFilter(false); // 错误页面有容器来处理,而不是SpringBoot
|
||||
return builder.sources(AiMcpApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.ai.mcp.config;
|
||||
|
||||
import com.jeesite.modules.ai.tools.TestAiTools;
|
||||
import com.jeesite.modules.ai.tools.UserAITools;
|
||||
import org.springframework.ai.tool.ToolCallbackProvider;
|
||||
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
/**
|
||||
* AI MCP 服务配置
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Lazy(false)
|
||||
@Configuration
|
||||
public class McpServerConfig {
|
||||
|
||||
@Bean
|
||||
public ToolCallbackProvider mcpServerTools(TestAiTools testAiTools, UserAITools userAITools) {
|
||||
return MethodToolCallbackProvider.builder().toolObjects(testAiTools, userAITools).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
# 使用环境配置,只需 JVM 参数里加:-Dspring.profiles.active=prod
|
||||
|
||||
#======================================#
|
||||
#========== Server settings ===========#
|
||||
#======================================#
|
||||
|
||||
server:
|
||||
|
||||
port: 8980
|
||||
servlet:
|
||||
context-path: /js
|
||||
|
||||
#======================================#
|
||||
#========= Database settings ==========#
|
||||
#======================================#
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
|
||||
# Mysql 数据库配置
|
||||
type: mysql
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.56.1:3306/jeesite?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
|
||||
username: jeesite
|
||||
password: jeesite
|
||||
testSql: SELECT 1
|
||||
|
||||
# 数据库连接池配置
|
||||
pool:
|
||||
|
||||
# 初始化连接数
|
||||
init: 1
|
||||
# 最小连接数
|
||||
minIdle: 3
|
||||
# 最大连接数
|
||||
maxActive: 20
|
||||
|
||||
#======================================#
|
||||
#========== Spring settings ===========#
|
||||
#======================================#
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
config: classpath:config/logback-spring-prod.xml
|
||||
|
||||
# MyBatis 相关
|
||||
mybatis:
|
||||
|
||||
# Mapper文件刷新线程
|
||||
mapper:
|
||||
refresh:
|
||||
enabled: false
|
||||
171
web-ai/web-ai-mcp/src/main/resources/config/application.yml
Normal file
171
web-ai/web-ai-mcp/src/main/resources/config/application.yml
Normal file
@@ -0,0 +1,171 @@
|
||||
|
||||
#======================================#
|
||||
#========== Project settings ==========#
|
||||
#======================================#
|
||||
|
||||
# 产品或项目名称、软件开发公司名称
|
||||
productName: JeeSite MCP Server
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.14
|
||||
copyrightYear: 2025
|
||||
|
||||
# 是否演示模式
|
||||
demoMode: false
|
||||
|
||||
# 专为分离端提供接口服务
|
||||
apiMode: false
|
||||
|
||||
#======================================#
|
||||
#========== Server settings ===========#
|
||||
#======================================#
|
||||
|
||||
server:
|
||||
|
||||
port: 8981
|
||||
# servlet:
|
||||
# context-path: /js
|
||||
# register-default-servlet: false
|
||||
# tomcat:
|
||||
# uri-encoding: UTF-8
|
||||
# max-http-form-post-size: 20MB
|
||||
#
|
||||
# # 当 Nginx 为 https,tomcat 为 http 时,设置该选项为 true
|
||||
# schemeHttps: false
|
||||
|
||||
#======================================#
|
||||
#========= Database settings ==========#
|
||||
#======================================#
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
|
||||
# Mysql 数据库配置
|
||||
type: mysql
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
testSql: SELECT 1
|
||||
|
||||
# 数据库连接池配置
|
||||
pool:
|
||||
|
||||
# 初始化连接数
|
||||
init: 1
|
||||
# 最小连接数
|
||||
minIdle: 3
|
||||
# 最大连接数
|
||||
maxActive: 20
|
||||
|
||||
#======================================#
|
||||
#========== Framework settings ========#
|
||||
#======================================#
|
||||
|
||||
spring:
|
||||
|
||||
# 应用程序名称
|
||||
application:
|
||||
name: jeesite-web-ai-mcp
|
||||
|
||||
# 环境名称(注意:不可设置为 test 它是单元测试专用的名称)
|
||||
profiles:
|
||||
active: default
|
||||
|
||||
# 打印横幅
|
||||
main:
|
||||
banner-mode: "off"
|
||||
lazy-initialization: false
|
||||
|
||||
# # MVC 映射匹配策略
|
||||
# mvc:
|
||||
# pathmatch:
|
||||
# matching-strategy: ANT_PATH_MATCHER
|
||||
|
||||
# JTA XA 事务(spring boot 3)
|
||||
jta:
|
||||
enabled: false
|
||||
|
||||
# 缓存配置
|
||||
cache:
|
||||
# 缓存及会话共享(专业版)
|
||||
isClusterMode: false
|
||||
|
||||
# ========= MPC Server 相关配置 =========
|
||||
|
||||
# https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html
|
||||
ai:
|
||||
mcp:
|
||||
server:
|
||||
enabled: true
|
||||
name: jeesite-mcp-server
|
||||
version: 1.0.0
|
||||
type: SYNC
|
||||
sse-endpoint: /api/v1/sse
|
||||
sse-message-endpoint: /api/v1/mcp
|
||||
capabilities:
|
||||
tool: true
|
||||
resource: true
|
||||
prompt: true
|
||||
completion: true
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
config: classpath:config/logback-spring.xml
|
||||
|
||||
# MyBatis 相关
|
||||
mybatis:
|
||||
|
||||
# Mapper文件刷新线程
|
||||
mapper:
|
||||
refresh:
|
||||
enabled: false
|
||||
|
||||
# 管理基础路径
|
||||
adminPath: /a
|
||||
|
||||
# 前端基础路径
|
||||
frontPath: /f
|
||||
|
||||
# 基础配置(参数、模块、字典)
|
||||
config:
|
||||
enabled: true
|
||||
|
||||
# 用户权限相关(用户、角色、菜单)
|
||||
user:
|
||||
enabled: true
|
||||
|
||||
# 国际化管理
|
||||
lang:
|
||||
enabled: false
|
||||
|
||||
# 任务调度
|
||||
job:
|
||||
enabled: false
|
||||
|
||||
# 代码生成
|
||||
gen:
|
||||
enabled: false
|
||||
|
||||
# 系统监控(默认开启,可关闭)访问地址如下:
|
||||
# 服务监控:http://127.0.0.1:8980/js/a/state/server/index
|
||||
state:
|
||||
enabled: true
|
||||
|
||||
# 核心功能 Controller 开关
|
||||
web:
|
||||
core:
|
||||
enabled: true
|
||||
|
||||
# 文件上传
|
||||
file:
|
||||
enabled: false
|
||||
|
||||
# 消息提醒中心
|
||||
msg:
|
||||
enabled: false
|
||||
|
||||
#======================================#
|
||||
#========== Project settings ==========#
|
||||
#======================================#
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
|
||||
<!-- Log file path -->
|
||||
<property name="log.path" value="${logPath:-${java.io.tmpdir:-.}}/logs" />
|
||||
|
||||
<!-- Framework level setting -->
|
||||
<include resource="config/logger-default.xml" />
|
||||
|
||||
<!-- Production level setting -->
|
||||
<logger name="org.mybatis.spring.transaction" level="INFO" />
|
||||
<logger name="org.flowable.ui.modeler.domain" level="INFO" />
|
||||
<logger name="org.flowable.idm.engine.impl.persistence" level="INFO" />
|
||||
<logger name="org.flowable.task.service.impl.persistence" level="INFO" />
|
||||
<logger name="org.flowable.identitylink.service.impl.persistence" level="INFO" />
|
||||
<logger name="org.flowable.variable.service.impl.persistence" level="INFO" />
|
||||
<logger name="org.flowable.engine.impl.persistence" level="INFO" />
|
||||
<logger name="com.bstek.ureport" level="INFO" />
|
||||
<logger name="com.jeesite.modules" level="INFO" />
|
||||
|
||||
<!-- Project level setting -->
|
||||
<!-- <logger name="your.package" level="DEBUG" /> -->
|
||||
<logger name="io.modelcontextprotocol" level="INFO" />
|
||||
<logger name="org.springframework.ai" level="INFO" />
|
||||
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>DENY</onMatch>
|
||||
<onMismatch>NEUTRAL</onMismatch>
|
||||
</filter>-->
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="WARN">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="debug" />
|
||||
<appender-ref ref="error" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
|
||||
<!-- Log file path -->
|
||||
<property name="log.path" value="${logPath:-${java.io.tmpdir:-.}}/logs" />
|
||||
|
||||
<!-- Framework level setting -->
|
||||
<include resource="config/logger-core.xml" />
|
||||
|
||||
<!-- Project level setting -->
|
||||
<!-- <logger name="your.package" level="DEBUG" /> -->
|
||||
<logger name="io.modelcontextprotocol" level="TRACE" />
|
||||
<logger name="org.springframework.ai" level="TRACE" />
|
||||
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>DENY</onMatch>
|
||||
<onMismatch>NEUTRAL</onMismatch>
|
||||
</filter>-->
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="WARN">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="debug" />
|
||||
<appender-ref ref="error" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
BIN
web-ai/web-ai-mcp/src/main/resources/static/favicon.png
Normal file
BIN
web-ai/web-ai-mcp/src/main/resources/static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -0,0 +1,23 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law. */ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/fonts/font-icons.min.css">
|
||||
<link rel="stylesheet" href="${ctxStatic}/bootstrap/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="${ctxStatic}/select2/4.0/select2.css?${_version}">
|
||||
<link rel="stylesheet" href="${ctxStatic}/icheck/1.0/minimal/grey.css?${_version}">
|
||||
<% if (@ListUtils.inString('zTree', libs!)){ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/jquery-ztree/3.5/css/awesome/zTreeStyle.css?${_version}">
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('tabPage', libs!)){ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/wdScrollTab/css/TabPanel.css?${_version}">
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('dataGrid', libs!)){ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/jqGrid/4.7/css/ui.jqgrid.css?${_version}">
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('layout', libs!)){ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/jquery-plugins/jquery.layout-latest.css?${_version}">
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('fileupload', libs!)){ %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/webuploader/0.1/webuploader.extend.css?${_version}">
|
||||
<% } %>
|
||||
<link rel="stylesheet" href="${ctxStatic}/adminlte/css/AdminLTE.min.css?${_version}">
|
||||
<link rel="stylesheet" href="${ctxStatic}/common/jeesite.css?${_version}">
|
||||
11
web-ai/web-ai-mcp/src/main/resources/views/include/head.html
Normal file
11
web-ai/web-ai-mcp/src/main/resources/views/include/head.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law. */%>
|
||||
<meta charset="utf-8"><meta content="webkit" name="renderer"/><meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="PoweredByJeeSiteV4.0"/><meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
|
||||
<meta name="description" content="PoweredByJeeSiteV4.0"/><meta content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/>
|
||||
<meta content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
|
||||
<title>${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')}</title>
|
||||
<link rel="shortcut icon" href="${ctxStatic}/favicon.png" type="image/png">
|
||||
<script src="${ctxPath}/global.min.js?ctx=${ctx}"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-3.7.0.min.js"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-migrate-3.4.0.min.js"></script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law. */ %>
|
||||
<script src="${ctxStatic}/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="${ctxStatic}/select2/4.0/select2.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/select2/4.0/i18n/${lang()}.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/layer/3.5/layer.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/laydate/5.3/laydate.js?${_version}"></script>
|
||||
<% if (@ListUtils.inString('zTree', libs!)){ %>
|
||||
<script src="${ctxStatic}/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString(['tabPage', 'dataGrid', 'fileupload'], libs!)){ %>
|
||||
<script src="${ctxStatic}/jquery/jquery-ui-sortable-1.13.2.min.js"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('tabPage', libs!)){ %>
|
||||
<script src="${ctxStatic}/wdScrollTab/js/TabPanel.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/wdScrollTab/js/TabPanel.extend.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/wdScrollTab/js/TabPanel_i18n.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('dataGrid', libs!)){ %>
|
||||
<script src="${ctxStatic}/jqGrid/4.7/js/jquery.jqGrid.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jqGrid/4.7/js/jquery.jqGrid.extend.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jqGrid/4.7/js/i18n/${lang()}.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('validate', libs!)){ %>
|
||||
<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jquery-validation/1.16/localization/messages_${lang()}.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.extend.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('layout', libs!)){ %>
|
||||
<script src="${ctxStatic}/jquery/jquery-ui-draggable-1.13.2.min.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-ui-effect-1.13.2.min.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jquery-plugins/jquery.layout-latest.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('inputmask', libs!)){ %>
|
||||
<script src="${ctxStatic}/jquery-plugins/jquery.inputmask.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('fileupload', libs!)){ %>
|
||||
<script src="${ctxStatic}/webuploader/0.1/webuploader.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/webuploader/0.1/webuploader.extend.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/webuploader/0.1/i18n/${lang()}.js?${_version}"></script>
|
||||
<% } %>
|
||||
<% if (@ListUtils.inString('ueditor', libs!)){ %>
|
||||
<script src="${ctxStatic}/ueditor/1.4/ueditor.config.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/ueditor/1.4/ueditor.all.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/ueditor/1.4/lang/${lang()}/${lang()}.js?${_version}"></script>
|
||||
<% } %>
|
||||
<script src="${ctxStatic}/common/jeesite.js?${_version}"></script>
|
||||
<!--<script src="${ctxStatic}/common/i18n/jeesite_${lang()}.js?${_version}"></script>-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law. */ %>
|
||||
<% print('<'+'!DOC'+'TYPE html'+'>'); %>
|
||||
<% print('<'+'html'+'><'+'head'+'>'); %>
|
||||
<% include('/include/head.html', {title: text(title!)}){} %>
|
||||
<% include('/include/csslibs.html', {libs: libs!}){} %>
|
||||
</head><body class="hold-transition ${bodyClass!}">
|
||||
<% if (!@ListUtils.inString('layout', libs!)){ %>
|
||||
<div class="wrapper">${layoutContent}</div>
|
||||
<% }else{ %>${layoutContent}<% } %>
|
||||
<a id="scroll-up" href="#" class="btn btn-sm hide"><i class="fa fa-angle-double-up"></i></a>
|
||||
<% include('/include/jslibs.html', {libs: libs!}){} %>
|
||||
51
web-ai/web-ai-mcp/src/main/webapp/WEB-INF/startup.bat
Normal file
51
web-ai/web-ai-mcp/src/main/webapp/WEB-INF/startup.bat
Normal file
@@ -0,0 +1,51 @@
|
||||
@echo off
|
||||
rem /**
|
||||
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
rem * No deletion without permission, or be held responsible to law.
|
||||
rem *
|
||||
rem * Author: ThinkGem@163.com
|
||||
rem */
|
||||
echo.
|
||||
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̡<EFBFBD>
|
||||
echo.
|
||||
rem pause
|
||||
rem echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
title %cd%
|
||||
|
||||
rem <20><><EFBFBD><EFBFBD>JDKĿ¼
|
||||
rem set "JAVA_HOME=%cd%\jdk1.8.0_x64"
|
||||
|
||||
rem <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
||||
set "CLASS_PATH=%cd%/../"
|
||||
|
||||
rem <20>Ż<EFBFBD>JVM<56><4D><EFBFBD><EFBFBD>
|
||||
set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m"
|
||||
|
||||
rem <20><>ʽһ<CABD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飩
|
||||
rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml"
|
||||
|
||||
rem <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>ز<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod"
|
||||
|
||||
if "%JAVA_HOME%" == "" goto noJavaHome
|
||||
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||
goto end
|
||||
|
||||
:noJavaHome
|
||||
set RUN_JAVA=java
|
||||
goto runJava
|
||||
|
||||
:gotJavaHome
|
||||
set "RUN_JAVA=%JAVA_HOME%\bin\java"
|
||||
goto runJava
|
||||
|
||||
:runJava
|
||||
call "%RUN_JAVA%" -cp %CLASS_PATH% %JAVA_OPTS% org.springframework.boot.loader.launch.WarLauncher %*
|
||||
goto end
|
||||
|
||||
:end
|
||||
pause
|
||||
35
web-ai/web-ai-mcp/src/main/webapp/WEB-INF/startup.sh
Normal file
35
web-ai/web-ai-mcp/src/main/webapp/WEB-INF/startup.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# /**
|
||||
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
# * No deletion without permission, or be held responsible to law.
|
||||
# *
|
||||
# * Author: ThinkGem@163.com
|
||||
# */
|
||||
echo ""
|
||||
echo "[信息] 运行Web工程。"
|
||||
echo ""
|
||||
|
||||
cd "$(cd "$(dirname "$0")"; pwd)"
|
||||
|
||||
# 设置JDK目录
|
||||
# JAVA_HOME="$PWD/jdk1.8.0_x64"
|
||||
|
||||
# 设置类加载路径
|
||||
CLASS_PATH="$PWD/../"
|
||||
|
||||
# 优化JVM参数
|
||||
# JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1024m"
|
||||
|
||||
# 方式一、配置外部自定义的属性文件(建议)
|
||||
# JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD/app.yml"
|
||||
|
||||
# 方式二、配置环境名称,加载不同的属性文件
|
||||
# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod"
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
RUN_JAVA=java
|
||||
else
|
||||
RUN_JAVA="$JAVA_HOME"/bin/java
|
||||
fi
|
||||
|
||||
exec "$RUN_JAVA" -cp $CLASS_PATH $JAVA_OPTS org.springframework.boot.loader.launch.WarLauncher $@
|
||||
@@ -69,7 +69,7 @@
|
||||
<!-- 内容管理 AI + RAG 模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-cms-ai</artifactId>
|
||||
<artifactId>jeesite-module-ai-cms</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency> -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user