mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
@@ -223,7 +223,7 @@ public class MultiCustomDictionary extends DynamicCustomDictionary {
|
|||||||
if (customNatureCollector.isEmpty()) {
|
if (customNatureCollector.isEmpty()) {
|
||||||
for (int i = Nature.begin.ordinal() + 1; i < Nature.values().length; ++i) {
|
for (int i = Nature.begin.ordinal() + 1; i < Nature.values().length; ++i) {
|
||||||
Nature nature = Nature.values()[i];
|
Nature nature = Nature.values()[i];
|
||||||
if(Objects.nonNull(nature)) {
|
if (Objects.nonNull(nature)) {
|
||||||
customNatureCollector.add(nature);
|
customNatureCollector.add(nature);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,12 @@
|
|||||||
<version>${commons.lang.version}</version>
|
<version>${commons.lang.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid</artifactId>
|
||||||
|
<version>${alibaba.druid.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.tencent.supersonic.common.config;
|
||||||
|
|
||||||
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Primary
|
||||||
|
public class DataBaseConfig {
|
||||||
|
|
||||||
|
@Bean("h2")
|
||||||
|
@ConfigurationProperties("spring.datasource")
|
||||||
|
public DataSource dataSource() {
|
||||||
|
return new DruidDataSource();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.tencent.supersonic.common.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JdbcTemplateConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public JdbcTemplate jdbcTemplate(@Qualifier("h2") DataSource dataSource) {
|
||||||
|
return new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user