refactor all
This commit is contained in:
@@ -8,6 +8,7 @@ import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayDataSource;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -32,7 +33,9 @@ import java.util.List;
|
||||
@Configuration
|
||||
@MapperScan(basePackages = {
|
||||
"com.imyeyu.api.modules.git.mapper",
|
||||
"com.imyeyu.api.modules.gao.mapper",
|
||||
"com.imyeyu.api.modules.bill.mapper",
|
||||
"com.imyeyu.api.modules.user.mapper",
|
||||
"com.imyeyu.api.modules.blog.mapper",
|
||||
"com.imyeyu.api.modules.lyric.mapper",
|
||||
"com.imyeyu.api.modules.mirror.mapper",
|
||||
@@ -47,6 +50,7 @@ public class TimiServerDBConfig {
|
||||
|
||||
@Bean(name = "timiServerDataSource")
|
||||
@Primary
|
||||
@FlywayDataSource
|
||||
@ConfigurationProperties(prefix = "spring.datasource.timiserver")
|
||||
public DataSource getPrimaryDateSource() throws SQLException {
|
||||
HikariDataSource dataSource = new HikariDataSource();
|
||||
@@ -77,19 +81,16 @@ public class TimiServerDBConfig {
|
||||
{
|
||||
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
|
||||
List<String> mapperLocations = new ArrayList<>();
|
||||
mapperLocations.add("classpath:mapper/git/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/blog/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/common/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/system/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/journal/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/minecraft/**/*.xml");
|
||||
mapperLocations.add("classpath:mapper/timi-server/**/*.xml");
|
||||
for (String mapperLocation : mapperLocations) {
|
||||
resources.addAll(List.of(resourceResolver.getResources(mapperLocation)));
|
||||
}
|
||||
}
|
||||
String[] typeAliases = {
|
||||
"com.imyeyu.api.modules.git.entity",
|
||||
"com.imyeyu.api.modules.gao.entity",
|
||||
"com.imyeyu.api.modules.bill.entity",
|
||||
"com.imyeyu.api.modules.user.entity",
|
||||
"com.imyeyu.api.modules.blog.entity",
|
||||
"com.imyeyu.api.modules.lyric.entity",
|
||||
"com.imyeyu.api.modules.mirror.entity",
|
||||
|
||||
Reference in New Issue
Block a user