argo-vault-demo/src/main/kotlin/com/sangdol/demo/DataSourceLookupController.kt

27 lines
691 B
Kotlin

package com.sangdol.demo
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
@RestController
class DataSourceLookupController(
private val properties: DataSourceProperties,
) {
@GetMapping("/dataSource")
fun lookup(): DataSourceInfoResponse = DataSourceInfoResponse(
properties.url,
properties.username,
properties.password,
properties.driverClassName
)
}
data class DataSourceInfoResponse(
val url: String,
val username: String,
val password: String,
val driverClassName: String,
)