Commit 952ea90d authored by 张永's avatar 张永

升个版本

parent 278be934
Pipeline #166 canceled with stages
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.egolm</groupId> <groupId>com.egolm</groupId>
<artifactId>admin</artifactId> <artifactId>admin</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<description>B2B后台管理模块</description> <description>B2B后台管理模块</description>
<properties> <properties>
<start-class>com.egolm.admin.AdminApplication</start-class> <start-class>com.egolm.admin.AdminApplication</start-class>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version> <version>2.1.0.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.microsoft.sqlserver</groupId> <groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId> <artifactId>sqljdbc4</artifactId>
<version>4.0</version> <version>4.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.38</version> <version>1.2.38</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.egolm</groupId> <groupId>com.egolm</groupId>
<artifactId>common</artifactId> <artifactId>common</artifactId>
<version>0.0.1-RELEASE</version> <version>0.0.1-RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid</artifactId>
<version>1.1.6</version> <version>1.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version> <version>2.6.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId> <artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version> <version>2.6.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.ehcache</groupId> <groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId> <artifactId>ehcache</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration> <configuration>
<mainClass>${start-class}</mainClass> <mainClass>${start-class}</mainClass>
<layout>ZIP</layout> <layout>ZIP</layout>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<goals> <goals>
<goal>repackage</goal> <goal>repackage</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>my</id> <id>my</id>
<name>my</name> <name>my</name>
<url>http://git.egolm.com:9003/nexus/content/groups/public/</url> <url>http://git.egolm.com:9003/nexus/content/groups/public/</url>
</repository> </repository>
<repository> <repository>
<id>repo1</id> <id>repo1</id>
<name>repo1</name> <name>repo1</name>
<url>http://repo1.maven.org/maven2/</url> <url>http://repo1.maven.org/maven2/</url>
</repository> </repository>
<repository> <repository>
<id>mvnrepository</id> <id>mvnrepository</id>
<name>mvnrepository</name> <name>mvnrepository</name>
<url>http://mvnrepository.com/</url> <url>http://mvnrepository.com/</url>
</repository> </repository>
</repositories> </repositories>
</project> </project>
\ No newline at end of file
package com.egolm.admin.config.datasource; package com.egolm.admin.config.datasource;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.MySqlDialect; import com.egolm.common.jdbc.dialect.MySqlDialect;
@Configuration @Configuration
public class ConfigDataSourceConfig { public class ConfigDataSourceConfig {
@Bean @Bean
@Primary @Primary
@Qualifier("configDataSource") @Qualifier("configDataSource")
@ConfigurationProperties(prefix = "spring.datasource.config") @ConfigurationProperties(prefix = "spring.datasource.config")
public DataSource getDataSource() { public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build(); return DataSourceBuilder.create().type(DruidDataSource.class).build();
} }
@Bean @Bean
@Primary @Primary
@Qualifier("configTxManager") @Qualifier("configTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("configDataSource")DataSource dataSource) { public PlatformTransactionManager getTransactionManager(@Qualifier("configDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
} }
@Bean @Bean
@Primary @Primary
@Qualifier("configJdbcTemplate") @Qualifier("configJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("configDataSource")DataSource dataSource) { public JdbcTemplate getJdbcTemplate(@Qualifier("configDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(); JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource); jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new MySqlDialect()); jdbcTemplate.setDialect(new MySqlDialect());
jdbcTemplate.setSql_level(3); jdbcTemplate.setSql_level(3);
return jdbcTemplate; return jdbcTemplate;
} }
} }
\ No newline at end of file
package com.egolm.admin.config.datasource; package com.egolm.admin.config.datasource;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.SqlServerDialect; import com.egolm.common.jdbc.dialect.SqlServerDialect;
@Configuration @Configuration
public class ShopDataSourceConfig { public class ShopDataSourceConfig {
@Bean @Bean
@Qualifier("shopDataSource") @Qualifier("shopDataSource")
@ConfigurationProperties(prefix = "spring.datasource.shop") @ConfigurationProperties(prefix = "spring.datasource.shop")
public DataSource getDataSource() { public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build(); return DataSourceBuilder.create().type(DruidDataSource.class).build();
} }
@Bean @Bean
@Qualifier("shopTxManager") @Qualifier("shopTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("shopDataSource")DataSource dataSource) { public PlatformTransactionManager getTransactionManager(@Qualifier("shopDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
} }
@Bean @Bean
@Qualifier("shopJdbcTemplate") @Qualifier("shopJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("shopDataSource")DataSource dataSource) { public JdbcTemplate getJdbcTemplate(@Qualifier("shopDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(); JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource); jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new SqlServerDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
jdbcTemplate.setSql_level(3); jdbcTemplate.setSql_level(3);
return jdbcTemplate; return jdbcTemplate;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment