Skip to content

Commit c4cab6d

Browse files
committed
默认数据库切换为mysql
1 parent 47480b1 commit c4cab6d

File tree

16 files changed

+70
-56
lines changed

16 files changed

+70
-56
lines changed

auth/authentication-server/src/main/java/com/springboot/auth/authentication/config/WebServerSecurityConfig.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
package com.springboot.auth.authentication.config;
22

3+
import lombok.extern.slf4j.Slf4j;
34
import org.springframework.context.annotation.Configuration;
4-
import org.springframework.core.annotation.Order;
55
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
66
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
77
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
88

9-
import lombok.extern.slf4j.Slf4j;
10-
119
@Slf4j
1210
@Configuration
1311
@EnableWebSecurity
14-
@Order(1)
1512
public class WebServerSecurityConfig extends WebSecurityConfigurerAdapter {
1613

1714
@Override

auth/authentication-server/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spring:
2020
##password: ${REDIS_PASSWORD:}
2121
datasource:
2222
driver-class-name: com.mysql.jdbc.Driver
23-
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
23+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
2424
username: ${DATASOURCE_USERNAME:root}
25-
password: ${DATASOURCE_PASSWORD:123456}
25+
password: ${DATASOURCE_PASSWORD:root123}
2626

2727
zipkin:
2828
enabled: true

auth/authorization-server/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spring:
2020
##password: ${REDIS_PASSWORD:}
2121
datasource:
2222
driver-class-name: com.mysql.jdbc.Driver
23-
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
23+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
2424
username: ${DATASOURCE_USERNAME:root}
25-
password: ${DATASOURCE_PASSWORD:123456}
25+
password: ${DATASOURCE_PASSWORD:root123}
2626

2727
zipkin:
2828
enabled: true

auth/db/dml/oauth2_dml.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
INSERT INTO public.oauth_client_details (client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove)
1+
INSERT INTO oauth_client_details (client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove)
22
VALUES ('test_client', NULL, '$2a$10$2szDKjvKHJCWE6YQNznogOeQF3USZHmCYj1fG7YbfK.vnTgNKLzri', 'read', 'client_credentials,authorization_code,password,refresh_token', 'http://baidu.com', NULL, 7200, 108000, NULL, NULL);

auth/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,12 @@
5353
<artifactId>druid-spring-boot-starter</artifactId>
5454
<version>1.1.9</version>
5555
</dependency>
56+
<!--数据库-->
5657
<dependency>
5758
<groupId>mysql</groupId>
5859
<artifactId>mysql-connector-java</artifactId>
5960
<version>5.1.39</version>
6061
</dependency>
61-
<!--数据库-->
62-
<dependency>
63-
<groupId>org.postgresql</groupId>
64-
<artifactId>postgresql</artifactId>
65-
<version>9.4-1203-jdbc4</version>
66-
</dependency>
6762
<!--Redis缓存-->
6863
<dependency>
6964
<groupId>org.springframework.boot</groupId>

demos/producer-jpa/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
</dependency>
6060
<!--数据库-->
6161
<dependency>
62-
<groupId>org.postgresql</groupId>
63-
<artifactId>postgresql</artifactId>
64-
<version>9.4-1203-jdbc4</version>
62+
<groupId>mysql</groupId>
63+
<artifactId>mysql-connector-java</artifactId>
64+
<version>5.1.39</version>
6565
</dependency>
6666
<!--Swagger2 - RESTful API文档-->
6767
<dependency>

demos/producer-jpa/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spring:
2626
port: ${REDIS_PORT:6379}
2727
##password: ${REDIS_PASSWORD:}
2828
datasource:
29-
url: jdbc:${DATASOURCE_DB:postgresql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:5432}/sc_product
29+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_product?characterEncoding=UTF-8&useUnicode=true&useSSL=false
3030
username: ${DATASOURCE_USERNAME:postgres}
3131
password: ${DATASOURCE_PASSWORD:postgres}
3232
driver-class-name: ${DATASOURCE_DRIVER:org.postgresql.Driver}

demos/producer/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@
4646
<artifactId>druid-spring-boot-starter</artifactId>
4747
<version>1.1.9</version>
4848
</dependency>
49+
<!--数据库-->
4950
<dependency>
5051
<groupId>mysql</groupId>
5152
<artifactId>mysql-connector-java</artifactId>
5253
<version>5.1.39</version>
5354
</dependency>
54-
<!--数据库-->
55-
<dependency>
56-
<groupId>org.postgresql</groupId>
57-
<artifactId>postgresql</artifactId>
58-
<version>9.4-1203-jdbc4</version>
59-
</dependency>
6055
<dependency>
6156
<groupId>org.flywaydb</groupId>
6257
<artifactId>flyway-core</artifactId>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
DROP TABLE IF EXISTS product;
2+
CREATE TABLE product
3+
(
4+
id VARCHAR(20) PRIMARY KEY COMMENT '编号',
5+
name VARCHAR(200) NOT NULL COMMENT '产品名称',
6+
description VARCHAR(500) COMMENT '产品描述',
7+
deleted VARCHAR(1) DEFAULT 'N' NOT NULL COMMENT '是否已删除Y:已删除,N:未删除',
8+
created_time datetime DEFAULT now() NOT NULL COMMENT '创建时间',
9+
updated_time datetime DEFAULT now() NOT NULL COMMENT '更新时间',
10+
created_by VARCHAR(100) NOT NULL COMMENT '创建人',
11+
updated_by VARCHAR(100) NOT NULL COMMENT '更新人'
12+
) COMMENT '产品表';
13+
14+
15+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
DROP TABLE IF EXISTS product;
2+
CREATE TABLE product
3+
(
4+
id VARCHAR(20) PRIMARY KEY,
5+
name VARCHAR(200) NOT NULL,
6+
description VARCHAR(500),
7+
deleted VARCHAR(1) DEFAULT 'N' NOT NULL,
8+
created_time TIMESTAMP DEFAULT now() NOT NULL,
9+
updated_time TIMESTAMP DEFAULT now() NOT NULL,
10+
created_by VARCHAR(100) NOT NULL,
11+
updated_by VARCHAR(100) NOT NULL
12+
);
13+
14+
COMMENT ON COLUMN product.id IS '编号';
15+
COMMENT ON COLUMN product.name IS '产品名称';
16+
COMMENT ON COLUMN product.description IS '产品描述';
17+
COMMENT ON COLUMN product.deleted IS '是否已删除Y:已删除,N:未删除';
18+
COMMENT ON COLUMN product.created_time IS '创建时间';
19+
COMMENT ON COLUMN product.updated_time IS '更新时间';
20+
COMMENT ON COLUMN product.created_by IS '创建人';
21+
COMMENT ON COLUMN product.updated_by IS '更新人';
22+

demos/producer/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ spring:
2121
#password: ${REDIS_PASSWORD:123456}
2222
datasource:
2323
driver-class-name: com.mysql.jdbc.Driver
24-
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_product?characterEncoding=UTF-8&useUnicode=true&useSSL=false
24+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_product?characterEncoding=UTF-8&useUnicode=true&useSSL=false
2525
username: ${DATASOURCE_USERNAME:root}
26-
password: ${DATASOURCE_PASSWORD:123456}
26+
password: ${DATASOURCE_PASSWORD:root123}
2727

2828
zipkin:
2929
enabled: true

docker-compose/.env

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ POSTGRES_USERNAME=postgres
1111
POSTGRES_PASSWORD=postgres
1212

1313
### 数据源postgres实例
14-
DATASOURCE_DB=postgresql
15-
DATASOURCE_HOST=postgres
16-
DATASOURCE_PORT=5432
17-
DATASOURCE_USERNAME=postgres
18-
DATASOURCE_PASSWORD=postgres
19-
DATASOURCE_DRIVER=org.postgresql.Driver
14+
#DATASOURCE_DBTYPE=postgresql
15+
#DATASOURCE_HOST=postgres
16+
#DATASOURCE_PORT=5432
17+
#DATASOURCE_USERNAME=postgres
18+
#DATASOURCE_PASSWORD=postgres
19+
#DATASOURCE_DRIVER=org.postgresql.Driver
2020

2121
### 数据源mysql实例
22-
#DATASOURCE_DB=mysql
23-
#DATASOURCE_HOST=mysql
24-
#DATASOURCE_PORT=3306
25-
#DATASOURCE_USERNAME=root
26-
#DATASOURCE_PASSWORD=root123
27-
#DATASOURCE_DRIVER=com.mysql.jdbc.Driver
22+
DATASOURCE_DBTYPE=mysql
23+
DATASOURCE_HOST=mysql
24+
DATASOURCE_PORT=3306
25+
DATASOURCE_USERNAME=root
26+
DATASOURCE_PASSWORD=root123
27+
DATASOURCE_DRIVER=com.mysql.jdbc.Driver
2828

2929
### 分布式缓存
3030
REDIS_HOST=redis

gateway/gateway-admin/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spring:
2020
#password: ${REDIS_PASSWORD:}
2121
datasource:
2222
driver-class-name: com.mysql.jdbc.Driver
23-
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_gateway?characterEncoding=UTF-8&useUnicode=true&useSSL=false
23+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_gateway?characterEncoding=UTF-8&useUnicode=true&useSSL=false
2424
username: ${DATASOURCE_USERNAME:root}
25-
password: ${DATASOURCE_PASSWORD:123456}
25+
password: ${DATASOURCE_PASSWORD:root123}
2626

2727
zipkin:
2828
enabled: true

sysadmin/organization/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ spring:
2323
#password: ${REDIS_PASSWORD:123456}
2424
datasource:
2525
driver-class-name: com.mysql.jdbc.Driver
26-
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_admin?characterEncoding=UTF-8&useUnicode=true&useSSL=false
26+
url: jdbc:${DATASOURCE_DBTYPE:mysql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_admin?characterEncoding=UTF-8&useUnicode=true&useSSL=false
2727
username: ${DATASOURCE_USERNAME:root}
28-
password: ${DATASOURCE_PASSWORD:123456}
28+
password: ${DATASOURCE_PASSWORD:root123}
2929

3030
zipkin:
3131
enabled: true

webapps/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
</dependency>
4141
<!--数据库-->
4242
<dependency>
43-
<groupId>org.postgresql</groupId>
44-
<artifactId>postgresql</artifactId>
45-
<version>9.4-1203-jdbc4</version>
43+
<groupId>mysql</groupId>
44+
<artifactId>mysql-connector-java</artifactId>
45+
<version>5.1.39</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>org.flywaydb</groupId>

webapps/webapp-parent/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
<artifactId>mybatis-spring</artifactId>
2727
<version>2.0.0</version>
2828
</dependency>
29-
<dependency>
30-
<groupId>mysql</groupId>
31-
<artifactId>mysql-connector-java</artifactId>
32-
<version>5.1.39</version>
33-
</dependency>
34-
<dependency>
35-
<groupId>com.alibaba</groupId>
36-
<artifactId>druid-spring-boot-starter</artifactId>
37-
<version>1.1.9</version>
38-
</dependency>
3929
</dependencies>
4030

4131
</project>

0 commit comments

Comments
 (0)