Commit 5daacfc6 authored by 王舵's avatar 王舵

feature: 调整如下

- 增加启动 profile 区分环境
- fix: AgentToolManager中如果Tool 类是代理类则不能被 spring ai 正确识别,所以将传入 spring ai 中的Tool 类都降级为原始类
- 调整了data.sql, 默认启动不执行 scheam.sql
parent 53570949
...@@ -208,4 +208,5 @@ Thumbs.db ...@@ -208,4 +208,5 @@ Thumbs.db
.Trashes .Trashes
ehthumbs.db ehthumbs.db
Icon? Icon?
*.icon? *.icon?
\ No newline at end of file backend/src/main/resources/application-dev.yml
\ No newline at end of file
...@@ -309,7 +309,49 @@ ...@@ -309,7 +309,49 @@
</dependencies> </dependencies>
<profiles>
<!-- 开发环境(默认激活) -->
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault> <!-- 默认激活dev -->
</activation>
<properties>
<!-- 定义环境标识,对应配置文件后缀 -->
<spring.profiles.active>dev</spring.profiles.active>
</properties>
</profile>
<!-- 测试环境 -->
<profile>
<id>test</id>
<properties>
<spring.profiles.active>test</spring.profiles.active>
</properties>
</profile>
<!-- 生产环境 -->
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
</properties>
</profile>
</profiles>
<build> <build>
<resources>
<resource>
<!-- 配置文件所在目录 -->
<directory>src/main/resources</directory>
<filtering>true</filtering> <!-- 关键:开启资源过滤 -->
<includes>
<include>**/*</include> <!-- 包含所有配置文件 -->
</includes>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -322,6 +364,13 @@ ...@@ -322,6 +364,13 @@
</exclude> </exclude>
</excludes> </excludes>
</configuration> </configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
<!-- Maven Compiler Plugin --> <!-- Maven Compiler Plugin -->
......
...@@ -587,7 +587,8 @@ public class AgentChatService { ...@@ -587,7 +587,8 @@ public class AgentChatService {
// 这里只需要等待足够的时间让异步的onComplete回调执行完成 // 这里只需要等待足够的时间让异步的onComplete回调执行完成
try { try {
// 通过轮询检查是否已完成,最多等待5秒 // 通过轮询检查是否已完成,最多等待5秒
long maxWaitTime = 5000; // long maxWaitTime = 5000;
long maxWaitTime = 60000;
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
while (!isCompleted.get() && (System.currentTimeMillis() - startTime) < maxWaitTime) { while (!isCompleted.get() && (System.currentTimeMillis() - startTime) < maxWaitTime) {
Thread.sleep(100); // 每100ms检查一次 Thread.sleep(100); // 每100ms检查一次
......
package pangea.hiagent.core; package pangea.hiagent.core;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,100 +22,103 @@ import java.util.stream.Collectors; ...@@ -19,100 +22,103 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
public class AgentToolManager { public class AgentToolManager {
@Autowired @Autowired
private pangea.hiagent.service.ToolService toolService; private pangea.hiagent.service.ToolService toolService;
@Autowired @Autowired
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
/** /**
* 获取Agent可用的工具列表 * 获取Agent可用的工具列表
*
* @param agent Agent对象 * @param agent Agent对象
* @return 工具列表 * @return 工具列表
*/ */
public List<Tool> getAvailableTools(Agent agent) { public List<Tool> getAvailableTools(Agent agent) {
try { try {
log.info("获取Agent可用工具列表,Agent ID: {}, 名称: {}", agent.getId(), agent.getName()); log.info("获取Agent可用工具列表,Agent ID: {}, 名称: {}", agent.getId(), agent.getName());
// 获取Agent所有者的所有活跃工具 // 获取Agent所有者的所有活跃工具
List<Tool> allTools = toolService.getUserToolsByStatus(agent.getOwner(), "active"); List<Tool> allTools = toolService.getUserToolsByStatus(agent.getOwner(), "active");
log.info("用户所有活跃工具数量: {}", allTools != null ? allTools.size() : 0); log.info("用户所有活跃工具数量: {}", allTools != null ? allTools.size() : 0);
if (allTools == null || allTools.isEmpty()) { if (allTools == null || allTools.isEmpty()) {
log.warn("Agent: {} 没有配置可用的工具", agent.getId()); log.warn("Agent: {} 没有配置可用的工具", agent.getId());
return List.of(); return List.of();
} }
// 如果Agent配置了特定的工具列表,则只返回配置的工具 // 如果Agent配置了特定的工具列表,则只返回配置的工具
List<String> toolNames = agent.getToolNames(); List<String> toolNames = agent.getToolNames();
log.info("Agent配置的工具名称列表: {}", toolNames); log.info("Agent配置的工具名称列表: {}", toolNames);
if (toolNames != null && !toolNames.isEmpty()) { if (toolNames != null && !toolNames.isEmpty()) {
// 根据工具名称筛选工具 // 根据工具名称筛选工具
List<Tool> filteredTools = filterToolsByName(allTools, toolNames); List<Tool> filteredTools = filterToolsByName(allTools, toolNames);
log.info("筛选后的工具数量: {}", filteredTools.size()); log.info("筛选后的工具数量: {}", filteredTools.size());
return filteredTools; return filteredTools;
} }
return allTools; return allTools;
} catch (Exception e) { } catch (Exception e) {
log.error("获取Agent可用工具时发生错误", e); log.error("获取Agent可用工具时发生错误", e);
return List.of(); return List.of();
} }
} }
/** /**
* 根据工具名称筛选工具 * 根据工具名称筛选工具
* @param allTools 所有工具 *
* @param allTools 所有工具
* @param toolNames 工具名称列表 * @param toolNames 工具名称列表
* @return 筛选后的工具列表 * @return 筛选后的工具列表
*/ */
public List<Tool> filterToolsByName(List<Tool> allTools, List<String> toolNames) { public List<Tool> filterToolsByName(List<Tool> allTools, List<String> toolNames) {
return allTools.stream() return allTools.stream()
.filter(tool -> toolNames.contains(tool.getName())) .filter(tool -> toolNames.contains(tool.getName()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/** /**
* 根据工具名称集合筛选工具实例(用于ReActService) * 根据工具名称集合筛选工具实例(用于ReActService)
* @param allTools 所有工具实例 *
* @param allTools 所有工具实例
* @param toolNames 工具名称集合 * @param toolNames 工具名称集合
* @return 筛选后的工具实例列表 * @return 筛选后的工具实例列表
*/ */
public List<Object> filterToolsByInstances(List<Object> allTools, Set<String> toolNames) { public List<Object> filterToolsByInstances(List<Object> allTools, Set<String> toolNames) {
log.debug("开始筛选工具实例,工具名称集合: {}", toolNames); log.debug("开始筛选工具实例,工具名称集合: {}", toolNames);
if (toolNames == null || toolNames.isEmpty()) { if (toolNames == null || toolNames.isEmpty()) {
log.debug("工具名称集合为空,返回所有工具实例"); log.debug("工具名称集合为空,返回所有工具实例");
return allTools; return allTools;
} }
List<Object> filteredTools = allTools.stream() List<Object> filteredTools = allTools.stream()
.filter(tool -> { .filter(tool -> {
// 获取工具类名(不含包名) // 获取工具类名(不含包名)
String className = tool.getClass().getSimpleName(); String className = tool.getClass().getSimpleName();
log.debug("检查工具类: {}", className); log.debug("检查工具类: {}", className);
// 检查类名是否匹配 // 检查类名是否匹配
boolean isMatch = toolNames.contains(className) || boolean isMatch = toolNames.contains(className) ||
toolNames.stream().anyMatch(name -> toolNames.stream().anyMatch(name -> className.toLowerCase().contains(name.toLowerCase()));
className.toLowerCase().contains(name.toLowerCase()));
if (isMatch) {
if (isMatch) { log.debug("工具 {} 匹配成功", className);
log.debug("工具 {} 匹配成功", className); }
}
return isMatch;
return isMatch; })
}) .collect(Collectors.toList());
.collect(Collectors.toList());
log.debug("筛选完成,返回 {} 个工具实例", filteredTools.size()); log.debug("筛选完成,返回 {} 个工具实例", filteredTools.size());
return filteredTools; return filteredTools;
} }
/** /**
* 构建工具描述文本 * 构建工具描述文本
*
* @param tools 工具列表 * @param tools 工具列表
* @return 工具描述文本 * @return 工具描述文本
*/ */
...@@ -120,7 +126,7 @@ public class AgentToolManager { ...@@ -120,7 +126,7 @@ public class AgentToolManager {
if (tools.isEmpty()) { if (tools.isEmpty()) {
return "(暂无可用工具)"; return "(暂无可用工具)";
} }
StringBuilder description = new StringBuilder(); StringBuilder description = new StringBuilder();
for (int i = 0; i < tools.size(); i++) { for (int i = 0; i < tools.size(); i++) {
Tool tool = tools.get(i); Tool tool = tools.get(i);
...@@ -134,47 +140,58 @@ public class AgentToolManager { ...@@ -134,47 +140,58 @@ public class AgentToolManager {
} }
description.append("\n"); description.append("\n");
} }
return description.toString(); return description.toString();
} }
/** /**
* 检查字符串是否有值 * 检查字符串是否有值
*
* @param value 字符串值 * @param value 字符串值
* @return 是否有值 * @return 是否有值
*/ */
private boolean hasValue(String value) { private boolean hasValue(String value) {
return value != null && !value.isEmpty(); return value != null && !value.isEmpty();
} }
/** /**
* 根据Agent获取可用的工具实例 * 根据Agent获取可用的工具实例
*
* @param agent Agent对象 * @param agent Agent对象
* @return 工具实例列表 * @return 工具实例列表
*/ */
public List<Object> getAvailableToolInstances(Agent agent) { public List<Object> getAvailableToolInstances(Agent agent) {
// 获取Agent可用的工具定义 // 获取Agent可用的工具定义
List<Tool> availableTools = getAvailableTools(agent); List<Tool> availableTools = getAvailableTools(agent);
// 获取所有Spring管理的bean名称 // 获取所有Spring管理的bean名称
String[] beanNames = applicationContext.getBeanDefinitionNames(); String[] beanNames = applicationContext.getBeanDefinitionNames();
// 根据工具名称筛选对应的工具实例 // 根据工具名称筛选对应的工具实例
List<Object> toolInstances = new ArrayList<>(); List<Object> toolInstances = new ArrayList<>();
Set<String> availableToolNames = availableTools.stream() Set<String> availableToolNames = availableTools.stream()
.map(Tool::getName) .map(Tool::getName)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
for (String beanName : beanNames) { for (String beanName : beanNames) {
Object bean = applicationContext.getBean(beanName); Object bean = applicationContext.getBean(beanName);
String simpleClassName = bean.getClass().getSimpleName(); String simpleClassName = bean.getClass().getSimpleName();
// 判断是否是代理类,如果是代理类,获取目标类
if (AopUtils.isAopProxy(bean)) {
log.debug("beanName: {} 是代理类,尝试获取目标类", beanName);
try {
bean = ((Advised) bean).getTargetSource().getTarget();
simpleClassName = bean.getClass().getSimpleName();
} catch (Exception e) {
e.printStackTrace();
}
}
// 检查bean的类名是否与可用工具名称匹配 // 检查bean的类名是否与可用工具名称匹配
if (availableToolNames.contains(simpleClassName)) { if (availableToolNames.contains(simpleClassName)) {
toolInstances.add(bean); toolInstances.add(bean);
} }
} }
log.info("智能体{}获取到的工具实例数量: {}", agent.getName(), toolInstances.size()); log.info("智能体{}获取到的工具实例数量: {}", agent.getName(), toolInstances.size());
return toolInstances; return toolInstances;
......
...@@ -22,7 +22,8 @@ spring: ...@@ -22,7 +22,8 @@ spring:
sql: sql:
init: init:
schema-locations: classpath:schema.sql schema-locations: classpath:schema.sql
mode: always mode: never
# mode: always
# JPA/Hibernate配置 # JPA/Hibernate配置
jpa: jpa:
......
-- 插入默认数据 -- 插入默认数据
-- 插入默认用户数据 -- 插入默认用户数据
# INSERT INTO sys_user (id, username, password, email, nickname, status, role) VALUES INSERT INTO sys_user (id, username, password, email, nickname, status, role) VALUES
# ('user-001', 'admin', '$2a$10$N.zmdr9k7uOCQb0bta/OauRxaOKSr.QhqyD2R5FKvMQjmHoLkm5Sy', 'admin@hiagent.com', 'Admin', 'active', 'admin'); ('user-001', 'admin', '$2a$10$N.zmdr9k7uOCQb0bta/OauRxaOKSr.QhqyD2R5FKvMQjmHoLkm5Sy', 'admin@hiagent.com', 'Admin', 'active', 'admin');
#
# -- 插入默认LLM配置数据
# INSERT INTO llm_config (id, name, description, provider, model_name, api_key, base_url, temperature, max_tokens, top_p, enabled, owner) VALUES
# ('deepseek-default', 'deepseek-default', 'DeepSeek默认配置', 'deepseek', 'deepseek-chat', '', 'https://api.deepseek.com', 0.7, 4096, 0.9, true, 'user-001'),
# ('openai-default', 'openai-default', 'OpenAI默认配置', 'openai', 'gpt-3.5-turbo', '', 'https://api.openai.com/v1', 0.7, 4096, 0.9, false, 'user-001'),
# ('ollama-default', 'ollama-default', 'Ollama默认配置', 'ollama', 'llama2', '', 'http://localhost:11434', 0.7, 4096, 0.9, true, 'user-001'),
# ('hisense-default', 'hisense-default', 'Hisense默认配置', 'hisense', 'gpt-4-1', '', 'http://openai-proxy-v2-jt-higpt.cloudprd.hisense.com', 0.7, 4096, 0.9, true, 'user-001');
#
# -- 插入默认Agent数据
# INSERT INTO agent (id, name, description, status, default_model, owner, system_prompt, enable_re_act, history_length, enable_rag, rag_collection_id, rag_top_k, rag_score_threshold, tools) VALUES
# ('agent-1', '客服助手', '处理客户咨询的AI助手', 'active', 'deepseek-default', 'user-001', '你是一个专业的客服助手,请用友好和专业的态度回答客户的问题。', 1, 15, 1, 'customer-service-kb', 5, 0.8, '["search", "orderQuery", "refundProcessing"]'),
# ('agent-2', '技术支持', '提供技术支持服务的AI助手', 'active', 'openai-default', 'user-001', '你是一个技术专家,请帮助用户解决技术问题。', 1, 15, 1, 'technical-support-kb', 5, 0.8, '["search", "calculator", "technicalDocumentationRetrieval", "technicalCodeExplanation"]'),
# ('agent-3', '数据分析员', '专业的数据分析AI助手', 'active', 'deepseek-default', 'user-001', '你是一个数据分析专家,擅长处理和分析各种数据。', 0, 15, 1, 'data-analysis-kb', 5, 0.8, '["calculator", "chartGeneration", "statisticalCalculation"]'),
# ('agent-4', '内容创作助手', '帮助撰写各类文案的AI助手', 'active', 'hisense-default', 'user-001', '你是一个创意写作专家,能够帮助用户创作各种类型的文案。', 0, 15, 1, 'content-creation-kb', 5, 0.8, '["search", "writingStyleReference", "documentTemplate"]'),
# ('agent-5', '学习导师', '个性化学习指导AI助手', 'active', 'hisense-default', 'user-001', '你是一个教育专家,能够根据用户需求提供个性化的学习建议。', 1, 15, 1, 'learning-mentor-kb', 5, 0.8, '["search", "studyPlanGeneration", "courseMaterialRetrieval"]');
# -- 插入默认工具数据 -- 插入默认LLM配置数据
# INSERT INTO tool (id, name, display_name, description, category, status, timeout, http_method) VALUES INSERT INTO llm_config (id, name, description, provider, model_name, api_key, base_url, temperature, max_tokens, top_p, enabled, owner) VALUES
# ('tool-1', 'search', '搜索工具', '进行网络搜索查询', 'API', 'active', 30000, 'GET'), ('deepseek-default', 'deepseek-default', 'DeepSeek默认配置', 'deepseek', 'deepseek-chat', '', 'https://api.deepseek.com', 0.7, 4096, 0.9, true, 'user-001'),
# ('tool-2', 'calculator', '计算器', '进行数学计算', 'FUNCTION', 'active', 5000, 'POST'), ('openai-default', 'openai-default', 'OpenAI默认配置', 'openai', 'gpt-3.5-turbo', '', 'https://api.openai.com/v1', 0.7, 4096, 0.9, false, 'user-001'),
# ('tool-3', 'weather', '天气查询', '查询天气信息', 'API', 'active', 10000, 'GET'), ('ollama-default', 'ollama-default', 'Ollama默认配置', 'ollama', 'llama2', '', 'http://localhost:11434', 0.7, 4096, 0.9, true, 'user-001'),
# ('tool-4', 'get_current_time', '获取当前时间', '获取当前系统时间', 'FUNCTION', 'active', 1000, 'GET'), ('hisense-default', 'hisense-default', 'Hisense默认配置', 'hisense', 'gpt-4-1', '', 'http://openai-proxy-v2-jt-higpt.cloudprd.hisense.com', 0.7, 4096, 0.9, true, 'user-001');
# ('tool-5', 'technicalDocumentationRetrieval', '技术文档检索', '检索和查询技术文档内容', 'FUNCTION', 'active', 10000, 'GET'),
# ('tool-6', 'technicalCodeExplanation', '技术代码解释', '分析和解释技术代码的功能和实现逻辑', 'FUNCTION', 'active', 10000, 'GET'), -- 插入默认Agent数据
# ('tool-7', 'chartGeneration', '图表生成', '根据数据生成各种类型的图表', 'FUNCTION', 'active', 10000, 'GET'), INSERT INTO agent (id, name, description, status, default_model, owner, system_prompt, enable_re_act, history_length, enable_rag, rag_collection_id, rag_top_k, rag_score_threshold, tools) VALUES
# ('tool-8', 'statisticalCalculation', '统计计算', '执行各种统计分析计算', 'FUNCTION', 'active', 10000, 'GET'), ('agent-1', '客服助手', '处理客户咨询的AI助手', 'active', 'deepseek-default', 'user-001', '你是一个专业的客服助手,请用友好和专业的态度回答客户的问题。', 1, 15, 1, 'customer-service-kb', 5, 0.8, '["search", "orderQuery", "refundProcessing","HisenseSsoAuthTool"]'),
# ('tool-9', 'writingStyleReference', '创作风格参考', '提供各种写作风格的参考和指导', 'FUNCTION', 'active', 10000, 'GET'), ('agent-2', '技术支持', '提供技术支持服务的AI助手', 'active', 'openai-default', 'user-001', '你是一个技术专家,请帮助用户解决技术问题。', 1, 15, 1, 'technical-support-kb', 5, 0.8, '["search", "calculator", "technicalDocumentationRetrieval", "technicalCodeExplanation"]'),
# ('tool-10', 'documentTemplate', '文档模板', '提供各种类型的文档模板', 'FUNCTION', 'active', 10000, 'GET'), ('agent-3', '数据分析员', '专业的数据分析AI助手', 'active', 'deepseek-default', 'user-001', '你是一个数据分析专家,擅长处理和分析各种数据。', 0, 15, 1, 'data-analysis-kb', 5, 0.8, '["calculator", "chartGeneration", "statisticalCalculation"]'),
# ('tool-11', 'studyPlanGeneration', '学习计划制定', '根据学习目标和时间安排制定个性化的学习计划', 'FUNCTION', 'active', 10000, 'GET'), ('agent-4', '内容创作助手', '帮助撰写各类文案的AI助手', 'active', 'hisense-default', 'user-001', '你是一个创意写作专家,能够帮助用户创作各种类型的文案。', 0, 15, 1, 'content-creation-kb', 5, 0.8, '["search", "writingStyleReference", "documentTemplate"]'),
# ('tool-12', 'courseMaterialRetrieval', '课程资料检索', '检索和查询相关课程资料', 'FUNCTION', 'active', 10000, 'GET'); ('agent-5', '学习导师', '个性化学习指导AI助手', 'active', 'hisense-default', 'user-001', '你是一个教育专家,能够根据用户需求提供个性化的学习建议。', 1, 15, 1, 'learning-mentor-kb', 5, 0.8, '["search", "studyPlanGeneration", "courseMaterialRetrieval"]');
#
# -- 插入oauth2.0 服务商信息 -- 插入默认工具数据
# INSERT INTO oauth2_provider INSERT INTO tool (id, name, display_name, description, category, status, timeout, http_method) VALUES
# (id, provider_name, display_name, description, auth_type, authorize_url, token_url, userinfo_url, client_id, client_secret, redirect_uri, `scope`, enabled, config_json, created_at, updated_at, created_by, updated_by, deleted, remark) ('tool-1', 'search', '搜索工具', '进行网络搜索查询', 'API', 'active', 30000, 'GET'),
# VALUES('hiagent', 'sso', 'sso', 'sso-provider', 'authorization_code', 'https://sso.hisense.com/esc-sso/oauth2.0/authorize', 'https://sso.hisense.com/esc-sso/oauth2.0/accessToken', 'https://sso.hisense.com/esc-sso/oauth2.0/profile', '', '', '', 'user', 1, '{}', '2025-12-17 17:26:57', '2025-12-17 17:27:48', '', '', 0, ''); ('tool-2', 'calculator', '计算器', '进行数学计算', 'FUNCTION', 'active', 5000, 'POST'),
('tool-3', 'weather', '天气查询', '查询天气信息', 'API', 'active', 10000, 'GET'),
('tool-4', 'get_current_time', '获取当前时间', '获取当前系统时间', 'FUNCTION', 'active', 1000, 'GET'),
('tool-5', 'technicalDocumentationRetrieval', '技术文档检索', '检索和查询技术文档内容', 'FUNCTION', 'active', 10000, 'GET'),
('tool-6', 'technicalCodeExplanation', '技术代码解释', '分析和解释技术代码的功能和实现逻辑', 'FUNCTION', 'active', 10000, 'GET'),
('tool-7', 'chartGeneration', '图表生成', '根据数据生成各种类型的图表', 'FUNCTION', 'active', 10000, 'GET'),
('tool-8', 'statisticalCalculation', '统计计算', '执行各种统计分析计算', 'FUNCTION', 'active', 10000, 'GET'),
('tool-9', 'writingStyleReference', '创作风格参考', '提供各种写作风格的参考和指导', 'FUNCTION', 'active', 10000, 'GET'),
('tool-10', 'documentTemplate', '文档模板', '提供各种类型的文档模板', 'FUNCTION', 'active', 10000, 'GET'),
('tool-11', 'studyPlanGeneration', '学习计划制定', '根据学习目标和时间安排制定个性化的学习计划', 'FUNCTION', 'active', 10000, 'GET'),
('tool-12', 'courseMaterialRetrieval', '课程资料检索', '检索和查询相关课程资料', 'FUNCTION', 'active', 10000, 'GET');
-- 插入oauth2.0 服务商信息
INSERT INTO oauth2_provider
(id, provider_name, display_name, description, auth_type, authorize_url, token_url, userinfo_url, client_id, client_secret, redirect_uri, `scope`, enabled, config_json, created_at, updated_at, created_by, updated_by, deleted, remark)
VALUES('hiagent', 'sso', 'sso', 'sso-provider', 'authorization_code', 'https://sso.hisense.com/esc-sso/oauth2.0/authorize', 'https://sso.hisense.com/esc-sso/oauth2.0/accessToken', 'https://sso.hisense.com/esc-sso/oauth2.0/profile', '', '', '', 'user', 1, '{}', '2025-12-17 17:26:57', '2025-12-17 17:27:48', '', '', 0, '');
-- 插入HisenseSsoAuthTool
INSERT INTO `hiagent`.`tool`(`id`, `name`, `display_name`, `description`, `category`, `status`, `parameters`, `return_type`, `return_schema`, `implementation`, `timeout`, `api_endpoint`, `http_method`, `headers`, `auth_type`, `auth_config`, `owner`, `created_at`, `updated_at`, `created_by`, `updated_by`, `deleted`, `remark`) VALUES
('tool-13', 'HisenseSsoAuthTool', 'Hisense SSO 认证工具', '用于 Hisense SSO 认证的工具', 'FUNCTION', 'active', NULL, NULL, NULL, NULL, 10000, NULL, 'GET', NULL, NULL, NULL, 'user-001', '2025-12-19 08:55:26', '2025-12-19 09:14:54', NULL, NULL, 0, NULL);
\ No newline at end of file
#!/bin/bash
###
# @Date: 2025-12-19 08:44:46
# @LastEditors: wangduo3 wangduo3@hisense.com
# @LastEditTime: 2025-12-19 14:39:27
# @FilePath: /pangea-agent/run-backend-with-env.sh
###
# 提取参数
ENV_PROFILE=$1
# 拼接启动命令(注意双引号保留参数格式,避免空格/特殊字符问题)
RUN_CMD="mvn spring-boot:run -P${ENV_PROFILE} -Dspring-boot.run.arguments=--spring.profiles.active=${ENV_PROFILE}"
cd backend
# 打印并执行命令
echo "执行启动命令:$RUN_CMD"
eval $RUN_CMD
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment