From b8efcc754e54adea7d10958acff9439788d8a786 Mon Sep 17 00:00:00 2001 From: jhhong0509 Date: Tue, 20 Sep 2022 22:24:37 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20sheme=EC=9D=84=20profile=EC=97=90?= =?UTF-8?q?=EB=94=B0=EB=9D=BC=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xquare/v1userservice/user/spi/AuthorityListSpiImpl.kt | 6 ++++-- .../com/xquare/v1userservice/user/spi/PointSpiImpl.kt | 8 +++++--- .../user/spi/SaveUserBaseApplicationSpiImpl.kt | 6 ++++-- .../user/spi/SaveUserBaseAuthoritySpiImpl.kt | 6 ++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/AuthorityListSpiImpl.kt b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/AuthorityListSpiImpl.kt index 2c61107..66fd54e 100644 --- a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/AuthorityListSpiImpl.kt +++ b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/AuthorityListSpiImpl.kt @@ -13,7 +13,9 @@ import org.springframework.web.reactive.function.client.awaitBody class AuthorityListSpiImpl( private val webClient: WebClient, @Value("\${service.authority.host}") - private val authorityHost: String + private val authorityHost: String, + @Value("\${service.scheme}") + private val scheme: String ) : AuthorityListSpi { override suspend fun getAuthorities(userId: UUID): List { val clientResponse = sendGetAuthoritiesRequest(userId) @@ -22,7 +24,7 @@ class AuthorityListSpiImpl( private suspend fun sendGetAuthoritiesRequest(userId: UUID): WebClient.ResponseSpec { return webClient.get().uri { uri -> - uri.scheme("http") + uri.scheme(scheme) .host(authorityHost) .path("/authorities/{userId}") .build(userId) diff --git a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/PointSpiImpl.kt b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/PointSpiImpl.kt index cb1859f..8ed997b 100644 --- a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/PointSpiImpl.kt +++ b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/PointSpiImpl.kt @@ -14,13 +14,15 @@ import org.springframework.web.reactive.function.client.awaitBody class PointSpiImpl( private val webClient: WebClient, @Value("\${service.point.host}") - private val pointHost: String + private val pointHost: String, + @Value("\${service.scheme}") + private val scheme: String ) : PointSpi { override suspend fun getUserPoint(userId: UUID): PointResponse { return webClient.get().uri { - it.scheme("http") + it.scheme(scheme) .host(pointHost) - .path("/point/{userId}") + .path("/points/{userId}") .build(userId) }.retrieve() .onStatus(HttpStatus::isError) { diff --git a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseApplicationSpiImpl.kt b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseApplicationSpiImpl.kt index b3fbcbd..d97f559 100644 --- a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseApplicationSpiImpl.kt +++ b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseApplicationSpiImpl.kt @@ -13,7 +13,9 @@ import org.springframework.web.reactive.function.client.awaitBodilessEntity class SaveUserBaseApplicationSpiImpl( private val webClient: WebClient, @Value("\${service.application.host}") - private val applicationHost: String + private val applicationHost: String, + @Value("\${service.scheme}") + private val scheme: String ) : SaveUserBaseApplicationProcessor, SaveUserBaseApplicationCompensator { override suspend fun processStep(userId: UUID) { val baseApplicationRequest = buildBaseApplicationRequest(userId) @@ -27,7 +29,7 @@ class SaveUserBaseApplicationSpiImpl( private suspend fun sendPostApplicationDefaultValue(saveUserBaseApplicationRequest: SaveUserBaseApplicationRequest) = webClient.post() .uri { - it.scheme("http") + it.scheme(scheme) .host(applicationHost) .path("/applications/signup") .build() diff --git a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseAuthoritySpiImpl.kt b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseAuthoritySpiImpl.kt index 6f96051..d198982 100644 --- a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseAuthoritySpiImpl.kt +++ b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/spi/SaveUserBaseAuthoritySpiImpl.kt @@ -14,7 +14,9 @@ import org.springframework.web.reactive.function.client.awaitBodilessEntity class SaveUserBaseAuthoritySpiImpl( private val webClient: WebClient, @Value("\${service.authority.host}") - private val authorityHost: String + private val authorityHost: String, + @Value("\${service.scheme}") + private val scheme: String ) : SaveUserBaseAuthorityProcessor, SaveUserBaseAuthorityCompensator { override suspend fun processStep(userId: UUID) { val request = SaveUserBaseAuthorityRequest(userId) @@ -24,7 +26,7 @@ class SaveUserBaseAuthoritySpiImpl( private suspend fun sendSaveUserBaseAuthorityRequest(saveUserBaseAuthorityRequest: SaveUserBaseAuthorityRequest) { webClient.post() .uri { - it.scheme("http") + it.scheme(scheme) .host(authorityHost) .path("/authorities/access-management/basic") .build()