Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL 데이터소스 설정 추가 #378

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions backend/src/main/java/com/votogether/config/OpenAPIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
public class OpenAPIConfig {

private final String devUrl;
private final String prodUrl;

public OpenAPIConfig(
@Value("${votogether.openapi.dev-url}") final String devUrl,
@Value("${votogether.openapi.prod-url}") final String prodUrl
) {
public OpenAPIConfig(@Value("${votogether.openapi.dev-url}") final String devUrl) {
this.devUrl = devUrl;
this.prodUrl = prodUrl;
}

@Bean
Expand All @@ -33,10 +28,6 @@ public OpenAPI openAPI() {
devServer.setUrl(devUrl);
devServer.description("개발 환경 서버 URL");

final Server prodServer = new Server();
prodServer.setUrl(prodUrl);
prodServer.description("운영 환경 서버 URL");

final Info info = new Info()
.title("VoTogether API")
.version("v1.0.0")
Expand All @@ -55,7 +46,7 @@ public OpenAPI openAPI() {

return new OpenAPI()
.info(info)
.servers(List.of(devServer, prodServer))
.servers(List.of(devServer))
.components(new Components().addSecuritySchemes("bearerAuth", securityScheme))
.security(List.of(securityRequirement));
}
Expand Down
27 changes: 11 additions & 16 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
spring:
datasource:
url: jdbc:h2:mem:test;MODE=MySQL
username: sa
driver-class-name: ${DATASOURCE_DRIVER_CLASS_NAME}
url: ${DATASOURCE_URL}
username: ${DATASOURCE_USERNAME}
password: ${DATASOURCE_PASSWORD}

jpa:
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true

properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
default_batch_fetch_size: 50
show-sql: true

hibernate:
ddl-auto: create
ddl-auto: ${HIBERNATE_DDL_AUTO}

servlet:
multipart:
Expand All @@ -21,19 +24,12 @@ spring:

h2:
console:
enabled: true
enabled: ${H2_CONSOLE_ENABLE}
path: /h2-console
settings:
web-allow-others: true

logging:
level:
org:
hibernate:
type:
descriptor:
sql:
BasicBinder: TRACE
org.hibernate.orm.jdbc.bind: trace

server:
forward-headers-strategy: FRAMEWORK
Expand All @@ -44,8 +40,7 @@ springdoc:

votogether:
openapi:
dev-url: http://localhost:8080
prod-url: ${PROD_URL}
dev-url: ${DEV_URL}

oauth:
kakao:
Expand Down
29 changes: 28 additions & 1 deletion backend/src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test;MODE=MySQL
username: sa
password:

jpa:
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true

properties:
hibernate:
format_sql: true
default_batch_fetch_size: 50

hibernate:
ddl-auto: create

servlet:
multipart:
max-file-size: 30MB
max-request-size: 30MB

h2:
console:
enabled: false
path: /h2-console

logging:
level:
org.hibernate.orm.jdbc.bind: trace

server:
forward-headers-strategy: FRAMEWORK

springdoc:
swagger-ui:
enabled: false

votogether:
openapi:
dev-url: http://localhost:8080
prod-url: http://aaaaaaaa.com

oauth:
kakao:
Expand Down