Skip to content

Commit

Permalink
refactor(config): delete unnecessary nested structure in db
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Jul 20, 2024
1 parent 2755cf6 commit 6445d56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
10 changes: 4 additions & 6 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
db {
ctx {
dataSourceClassName = "org.mariadb.jdbc.MariaDbDataSource"
dataSource.url = ${?QUALTET_DB_DATASOURCE_URL}
dataSource.user = ${?QUALTET_DB_USER}
dataSource.password = ${?QUALTET_DB_PASSWORD}
}
dataSourceClassName = "org.mariadb.jdbc.MariaDbDataSource"
dataSource.url = ${?QUALTET_DB_DATASOURCE_URL}
dataSource.user = ${?QUALTET_DB_USER}
dataSource.password = ${?QUALTET_DB_PASSWORD}
}

http {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ object ApplicationConfig {

private val config: TypeSafeConfig = ConfigFactory.load

private val dbUrl: String = config.getString("db.ctx.dataSource.url")
private val dbUser: String = config.getString("db.ctx.dataSource.user")
private val dbPassword: String = config.getString("db.ctx.dataSource.password")
private val dbUrl: String = config.getString("db.dataSource.url")
private val dbUser: String = config.getString("db.dataSource.user")
private val dbPassword: String = config.getString("db.dataSource.password")

private val httpHost: String = config.getString("http.host")
private val httpPort: Int = config.getInt("http.port")
Expand Down
10 changes: 4 additions & 6 deletions src/test/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
db {
ctx {
dataSourceClassName = "org.mariadb.jdbc.MariaDbDataSource"
dataSource.user = ${?QUALTET_DB_USER}
dataSource.password = ${?QUALTET_DB_PASSWORD}
dataSource.url = "jdbc:mariadb://127.0.0.1:33066/qualtet?useUnicode=true&characterEncoding=utf8mb4"
}
dataSourceClassName = "org.mariadb.jdbc.MariaDbDataSource"
dataSource.user = ${?QUALTET_DB_USER}
dataSource.password = ${?QUALTET_DB_PASSWORD}
dataSource.url = "jdbc:mariadb://127.0.0.1:33066/qualtet?useUnicode=true&characterEncoding=utf8mb4"
}

http {
Expand Down

0 comments on commit 6445d56

Please sign in to comment.