Commit cb252096 authored by lixuan's avatar lixuan

dev

parent 32b5b8eb
Pipeline #142771 passed with stages
in 4 minutes and 1 second
...@@ -3,10 +3,16 @@ package com.ruoyi; ...@@ -3,10 +3,16 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
/** /**
* 启动程序 * 启动程序
* *
...@@ -18,10 +24,12 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -18,10 +24,12 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAsync @EnableAsync
public class RuoYiApplication public class RuoYiApplication
{ {
public static void main(String[] args) public static void main(String[] args) throws SQLException {
{
// System.setProperty("spring.devtools.restart.enabled", "false"); // System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(RuoYiApplication.class, args);
DataSource dataSource = context.getBean(DataSource.class);
Connection connection = DataSourceUtils.getConnection(dataSource);
System.out.println("connection.getMetaData().getURL() = " + connection.getMetaData().getURL());
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" + " .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" + " | _ _ \\ \\ \\ / / \n" +
......
...@@ -97,16 +97,16 @@ spring: ...@@ -97,16 +97,16 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.31.145:3306/wst-be?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.70.2:3306/yichengstreet?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
username: root username: root
password: P@44w0rd password: Zhuo@2023
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: true enabled: true
url: jdbc:mysql://192.168.31.145:3306/wst-be-party?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.70.2:3306/yichengstreet-party?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
username: root username: root
password: P@44w0rd password: Zhuo@2023
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
......
...@@ -102,9 +102,9 @@ spring: ...@@ -102,9 +102,9 @@ spring:
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: true enabled: true
url: jdbc:mysql://10.36.21.12:3306/wst-be-party?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.70.2:3306/yichengstreet-party?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
username: wstroot username: root
password: Vp7xdDaxRsAbk password: Zhuo@2023
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
......
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