fix: 工作流实体保留字转义 + 千问向量模型厂商映射

1. WorkflowRuntimeNode/WorkflowRuntime: input/output/status 字段加反引号,
   修复 MySQL 8.0 保留字导致 MyBatis-Plus SQL 解析异常 (#307)
2. EmbeddingModelFactory: 新增 providerCode→BeanName 映射,
   qianwen→alibailian,修复千问向量模型找不到 Bean 的问题 (#301)

Closes #307 #301

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ageerle
2026-07-21 15:43:36 +08:00
parent a69d1f51b9
commit e42d35f3bf
3 changed files with 17 additions and 7 deletions

View File

@@ -25,6 +25,14 @@ import java.util.concurrent.ConcurrentHashMap;
@Slf4j
public class EmbeddingModelFactory {
/**
* 厂商 providerCode → Spring Bean 名称映射
* 处理 providerCode 与 @Component 注册名不一致的情况
*/
private static final Map<String, String> PROVIDER_BEAN_MAPPING = Map.of(
"qianwen", "alibailian"
);
private final ApplicationContext applicationContext;
private final IChatModelService chatModelService;
@@ -116,8 +124,10 @@ public class EmbeddingModelFactory {
*/
private BaseEmbedModelService createModelInstance(String factory, ChatModelVo config) {
try {
// 解析实际的 Bean 名称(处理 providerCode 与 @Component 注册名不一致的情况)
String beanName = PROVIDER_BEAN_MAPPING.getOrDefault(factory, factory);
// 从Spring上下文中获取模型实例
BaseEmbedModelService model = applicationContext.getBean(factory, BaseEmbedModelService.class);
BaseEmbedModelService model = applicationContext.getBean(beanName, BaseEmbedModelService.class);
// 配置模型参数
model.configure(config);
// 增加嵌入模型监听器