mirror of https://gitee.com/maxjhandsome/pig
⬆️ Upgrading dependencies. #I1HE98 up spring boot 2.3.0
This commit is contained in:
parent
856a4f7f81
commit
046d82ef5a
|
@ -4,12 +4,12 @@
|
|||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Pig-2.7-success.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Avue-2.3-green.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Avue-2.5-green.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR4-blue.svg" alt="Coverage Status">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.RELEASE-blue.svg" alt="Downloads">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.RELEASE-blue.svg" alt="Downloads">
|
||||
</p>
|
||||
|
||||
- based on Spring Cloud Hoxton 、Spring Boot 2.2、 OAuth2 RBAC web framework
|
||||
- based on Spring Cloud Hoxton 、Spring Boot 2.3、 OAuth2 RBAC web framework
|
||||
- Idea based on data-driven view, if you don't use vue, you can get started quickly
|
||||
- provide support for common containers like Docker、Kubernetes、Rancher2
|
||||
- provide lambda 、stream api 、webflux production practice
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
dependencies | version
|
||||
---|---
|
||||
Spring Boot | 2.2.7.RELEASE
|
||||
Spring Boot | 2.3.0.RELEASE
|
||||
Spring Cloud | Hoxton.SR4
|
||||
Spring Security OAuth2 | 2.3.6
|
||||
Mybatis Plus | 3.3.1
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Pig-2.7-success.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Avue-2.3-green.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Avue-2.5-green.svg" alt="Build Status">
|
||||
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR4-blue.svg" alt="Coverage Status">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.RELEASE-blue.svg" alt="Downloads">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.RELEASE-blue.svg" alt="Downloads">
|
||||
</p>
|
||||
|
||||
- 基于 Spring Cloud Hoxton 、Spring Boot 2.2、 OAuth2 的RBAC权限管理系统
|
||||
- 基于 Spring Cloud Hoxton 、Spring Boot 2.3、 OAuth2 的RBAC权限管理系统
|
||||
- 基于数据驱动视图的理念封装 element-ui,即使没有 vue 的使用经验也能快速上手
|
||||
- 提供对常见容器化支持 Docker、Kubernetes、Rancher2 支持
|
||||
- 提供 lambda 、stream api 、webflux 的生产实践
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
依赖 | 版本
|
||||
---|---
|
||||
Spring Boot | 2.2.7.RELEASE
|
||||
Spring Boot | 2.3.0.RELEASE
|
||||
Spring Cloud | Hoxton.SR4
|
||||
Spring Security OAuth2 | 2.3.6
|
||||
Mybatis Plus | 3.3.1
|
||||
|
|
|
@ -22,11 +22,12 @@ import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
|||
import com.baomidou.dynamic.datasource.creator.DataSourceCreator;
|
||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pig.codegen.service.GenDatasourceConfService;
|
||||
import com.pig4cloud.pig.codegen.entity.GenDatasourceConf;
|
||||
import com.pig4cloud.pig.codegen.mapper.GenDatasourceConfMapper;
|
||||
import com.pig4cloud.pig.codegen.service.GenDatasourceConfService;
|
||||
import com.pig4cloud.pig.common.core.util.SpringContextHolder;
|
||||
import com.pig4cloud.pig.common.datasource.support.DataSourceConstants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jasypt.encryption.StringEncryptor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -43,11 +44,10 @@ import java.sql.SQLException;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfMapper, GenDatasourceConf> implements GenDatasourceConfService {
|
||||
private DynamicRoutingDataSource dynamicRoutingDataSource;
|
||||
private final StringEncryptor stringEncryptor;
|
||||
private DataSourceCreator dataSourceCreator;
|
||||
private final DataSourceCreator dataSourceCreator;
|
||||
|
||||
/**
|
||||
* 保存数据源并且加密
|
||||
|
@ -83,8 +83,8 @@ public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfM
|
|||
return Boolean.FALSE;
|
||||
}
|
||||
//先移除
|
||||
dynamicRoutingDataSource.removeDataSource(
|
||||
baseMapper.selectById(conf.getId()).getName());
|
||||
SpringContextHolder.getBean(DynamicRoutingDataSource.class)
|
||||
.removeDataSource(baseMapper.selectById(conf.getId()).getName());
|
||||
|
||||
//再添加
|
||||
addDynamicDataSource(conf);
|
||||
|
@ -106,8 +106,8 @@ public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfM
|
|||
*/
|
||||
@Override
|
||||
public Boolean removeByDsId(Integer dsId) {
|
||||
dynamicRoutingDataSource.removeDataSource(
|
||||
baseMapper.selectById(dsId).getName());
|
||||
SpringContextHolder.getBean(DynamicRoutingDataSource.class)
|
||||
.removeDataSource(baseMapper.selectById(dsId).getName());
|
||||
this.baseMapper.deleteById(dsId);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
@ -126,7 +126,8 @@ public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfM
|
|||
dataSourceProperty.setPassword(conf.getPassword());
|
||||
dataSourceProperty.setDriverClassName(DataSourceConstants.DS_DRIVER);
|
||||
DataSource dataSource = dataSourceCreator.createDataSource(dataSourceProperty);
|
||||
dynamicRoutingDataSource.addDataSource(dataSourceProperty.getPollName(), dataSource);
|
||||
SpringContextHolder.getBean(DynamicRoutingDataSource.class)
|
||||
.addDataSource(dataSourceProperty.getPollName(), dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +139,7 @@ public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfM
|
|||
@Override
|
||||
public Boolean checkDataSource(GenDatasourceConf conf) {
|
||||
try {
|
||||
DriverManager.getConnection(conf.getUrl(),conf.getUsername(),conf.getPassword());
|
||||
DriverManager.getConnection(conf.getUrl(), conf.getUsername(), conf.getPassword());
|
||||
} catch (SQLException e) {
|
||||
log.error("数据源配置 {} , 获取链接失败", conf.getName(), e);
|
||||
return Boolean.FALSE;
|
||||
|
|
|
@ -38,6 +38,6 @@ public class ApplicationLoggerInitializer implements ApplicationContextInitializ
|
|||
|
||||
String logBase = environment.getProperty("LOGGING_PATH", "logs");
|
||||
// spring boot admin 直接加载日志
|
||||
System.setProperty("logging.file", String.format("%s/%s/debug.log", logBase, appName));
|
||||
System.setProperty("logging.file.name", String.format("%s/%s/debug.log", logBase, appName));
|
||||
}
|
||||
}
|
||||
|
|
3
pom.xml
3
pom.xml
|
@ -35,7 +35,7 @@
|
|||
<url>https://www.pig4cloud.com</url>
|
||||
|
||||
<properties>
|
||||
<spring-boot.version>2.2.7.RELEASE</spring-boot.version>
|
||||
<spring-boot.version>2.3.0.RELEASE</spring-boot.version>
|
||||
<spring-cloud.version>Hoxton.SR4</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -67,6 +67,7 @@
|
|||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!--配置文件加解密-->
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
|
|
Loading…
Reference in New Issue