mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-20 06:34:55 +00:00
(improvement)(build) Add spotless during the build process. (#1639)
This commit is contained in:
@@ -6,11 +6,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
||||
|
||||
/**
|
||||
* Headless Launcher
|
||||
**/
|
||||
/** Headless Launcher */
|
||||
@Slf4j
|
||||
@SpringBootApplication(scanBasePackages = {"com.tencent.supersonic"},
|
||||
@SpringBootApplication(
|
||||
scanBasePackages = {"com.tencent.supersonic"},
|
||||
exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
|
||||
public class HeadlessLauncher {
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.tencent.supersonic.db;
|
||||
|
||||
import com.github.pagehelper.PageInterceptor;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.github.pagehelper.PageInterceptor;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.plugin.Interceptor;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
@@ -11,7 +12,6 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
|
||||
@Configuration
|
||||
@MapperScan(value = "com.tencent.supersonic", annotationClass = Mapper.class)
|
||||
public class MybatisConfig {
|
||||
@@ -19,15 +19,17 @@ public class MybatisConfig {
|
||||
private static final String MAPPER_LOCATION = "classpath*:mapper/**/*.xml";
|
||||
|
||||
@Bean
|
||||
public SqlSessionFactory sqlSessionFactory(DataSource dataSource, PageInterceptor pageInterceptor)
|
||||
throws Exception {
|
||||
public SqlSessionFactory sqlSessionFactory(
|
||||
DataSource dataSource, PageInterceptor pageInterceptor) throws Exception {
|
||||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||
org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
|
||||
org.apache.ibatis.session.Configuration configuration =
|
||||
new org.apache.ibatis.session.Configuration();
|
||||
configuration.setMapUnderscoreToCamelCase(true);
|
||||
bean.setConfiguration(configuration);
|
||||
bean.setDataSource(dataSource);
|
||||
bean.setPlugins(new Interceptor[]{pageInterceptor});
|
||||
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MAPPER_LOCATION));
|
||||
bean.setPlugins(new Interceptor[] {pageInterceptor});
|
||||
bean.setMapperLocations(
|
||||
new PathMatchingResourcePatternResolver().getResources(MAPPER_LOCATION));
|
||||
return bean.getObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tencent.supersonic.db;
|
||||
|
||||
import com.github.pagehelper.PageInterceptor;
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@Configuration
|
||||
public class PageHelperConfig {
|
||||
|
||||
Reference in New Issue
Block a user