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"
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>
<groupId>com.egolm</groupId>
<artifactId>admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>B2B后台管理模块</description>
<properties>
<start-class>com.egolm.admin.AdminApplication</start-class>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.38</version>
</dependency>
<dependency>
<groupId>com.egolm</groupId>
<artifactId>common</artifactId>
<version>0.0.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>my</id>
<name>my</name>
<url>http://git.egolm.com:9003/nexus/content/groups/public/</url>
</repository>
<repository>
<id>repo1</id>
<name>repo1</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://mvnrepository.com/</url>
</repository>
</repositories>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.egolm</groupId>
<artifactId>admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>B2B后台管理模块</description>
<properties>
<start-class>com.egolm.admin.AdminApplication</start-class>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.38</version>
</dependency>
<dependency>
<groupId>com.egolm</groupId>
<artifactId>common</artifactId>
<version>0.0.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>my</id>
<name>my</name>
<url>http://git.egolm.com:9003/nexus/content/groups/public/</url>
</repository>
<repository>
<id>repo1</id>
<name>repo1</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://mvnrepository.com/</url>
</repository>
</repositories>
</project>
\ No newline at end of file
package com.egolm.admin.config.datasource;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
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 org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.MySqlDialect;
@Configuration
public class ConfigDataSourceConfig {
@Bean
@Primary
@Qualifier("configDataSource")
@ConfigurationProperties(prefix = "spring.datasource.config")
public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build();
}
@Bean
@Primary
@Qualifier("configTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("configDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Primary
@Qualifier("configJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("configDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new MySqlDialect());
jdbcTemplate.setSql_level(3);
return jdbcTemplate;
}
package com.egolm.admin.config.datasource;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.MySqlDialect;
@Configuration
public class ConfigDataSourceConfig {
@Bean
@Primary
@Qualifier("configDataSource")
@ConfigurationProperties(prefix = "spring.datasource.config")
public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build();
}
@Bean
@Primary
@Qualifier("configTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("configDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Primary
@Qualifier("configJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("configDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new MySqlDialect());
jdbcTemplate.setSql_level(3);
return jdbcTemplate;
}
}
\ No newline at end of file
package com.egolm.admin.config.datasource;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.SqlServerDialect;
@Configuration
public class ShopDataSourceConfig {
@Bean
@Qualifier("shopDataSource")
@ConfigurationProperties(prefix = "spring.datasource.shop")
public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build();
}
@Bean
@Qualifier("shopTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("shopDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Qualifier("shopJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("shopDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new SqlServerDialect());
jdbcTemplate.setSql_level(3);
return jdbcTemplate;
}
package com.egolm.admin.config.datasource;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.SqlServerDialect;
@Configuration
public class ShopDataSourceConfig {
@Bean
@Qualifier("shopDataSource")
@ConfigurationProperties(prefix = "spring.datasource.shop")
public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build();
}
@Bean
@Qualifier("shopTxManager")
public PlatformTransactionManager getTransactionManager(@Qualifier("shopDataSource")DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Qualifier("shopJdbcTemplate")
public JdbcTemplate getJdbcTemplate(@Qualifier("shopDataSource")DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new SqlServerDialect());
jdbcTemplate.setSql_level(3);
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