mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
🚚 Moving or renaming files.
This commit is contained in:
1 parent
a15ed20ed7
commit
e2df067f8a
3 files changed
+41
No files matched your search
@@ -40,6 +40,11 @@
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<!-- druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.pig4cloud.pigx.ureport.config;
|
||||
|
||||
import com.bstek.ureport.definition.datasource.BuildinDatasource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/11/30
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class InnerDatasource implements BuildinDatasource {
|
||||
private final DataSource datasource;
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "内部数据源";
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
// 通过yaml 配置数据源信息
|
||||
return datasource.getConnection();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,11 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: @artifactId@
|
||||
datasource:
|
||||
url: jdbc:mysql://pigx-mysql:3306/pigxx?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
|
||||
Reference in new issue
Block a user