update ds_pgvector

This commit is contained in:
thinkgem
2025-04-08 15:36:53 +08:00
parent 9684e75697
commit e69cc355b3
2 changed files with 7 additions and 7 deletions

View File

@@ -13,9 +13,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.sql.DataSource;
import java.sql.SQLException;
/**
* AI 聊天配置类
* @author ThinkGem
@@ -55,10 +52,9 @@ public class CmsAiChatConfig {
@Bean
@Primary
@ConditionalOnProperty(name = "jdbc.ds_pgvector.type")
public JdbcTemplate pgVectorStoreJdbcTemplate() throws SQLException {
DataSource dataSource = DataSourceHolder.getRoutingDataSource()
.createDataSource("ds_pgvector");
return new JdbcTemplate(dataSource);
public JdbcTemplate pgVectorStoreJdbcTemplate() {
return DataSourceHolder.getRoutingDataSource()
.getJdbcTemplate("ds_pgvector");
}
}

View File

@@ -115,6 +115,10 @@ spring:
# username: postgres
# password: postgres
# testSql: SELECT 1
# pool:
# init: 0
# minIdle: 0
# breakAfterAcquireFailure: true
# ========= ES 向量数据库连接配置 =========