-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: name, profileImageUrl 갱신 안되는 현상 해결 (#27)
* fix: profile 조회 로직 오류 수정 * refactor * fix: name, profileImageUrl 업데이트 안되는 현상 해결
- Loading branch information
1 parent
d16f1b0
commit 7dba582
Showing
8 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/main/kotlin/com/poseplz/server/application/auth/ProviderUserNameService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package com.poseplz.server.application.auth | ||
|
||
import com.poseplz.server.domain.member.ProviderIdentifier | ||
|
||
interface ProviderUserNameService { | ||
fun getProviderUserName(loginRequestVo: LoginRequestVo): String? | ||
fun supports(loginRequestVo: LoginRequestVo): Boolean | ||
fun getProviderUserName(providerIdentifier: ProviderIdentifier): String? | ||
fun supports(providerIdentifier: ProviderIdentifier): Boolean | ||
} |
6 changes: 4 additions & 2 deletions
6
src/main/kotlin/com/poseplz/server/application/auth/ProviderUserProfileImageService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package com.poseplz.server.application.auth | ||
|
||
import com.poseplz.server.domain.member.ProviderIdentifier | ||
|
||
interface ProviderUserProfileImageService { | ||
fun getProviderUserProfileImage(loginRequestVo: LoginRequestVo): String? | ||
fun supports(loginRequestVo: LoginRequestVo): Boolean | ||
fun getProviderUserProfileImage(providerIdentifier: ProviderIdentifier): String? | ||
fun supports(providerIdentifier: ProviderIdentifier): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/main/kotlin/com/poseplz/server/infrastructure/kakao/KakaoUserNameService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package com.poseplz.server.infrastructure.kakao | ||
|
||
import com.poseplz.server.application.auth.LoginRequestVo | ||
import com.poseplz.server.application.auth.ProviderUserNameService | ||
import com.poseplz.server.domain.member.ProviderIdentifier | ||
import com.poseplz.server.domain.member.ProviderType | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class KakaoUserNameService( | ||
private val kakaoApiClient: KakaoApiClient, | ||
private val kakaoAdminApiClient: KakaoAdminApiClient, | ||
) : ProviderUserNameService { | ||
override fun getProviderUserName(loginRequestVo: LoginRequestVo): String? { | ||
return kakaoApiClient.getKakaoUserInfo(loginRequestVo.providerUserCredential!!) | ||
override fun getProviderUserName(providerIdentifier: ProviderIdentifier): String? { | ||
return kakaoAdminApiClient.getUserInfo(providerIdentifier.providerUserId) | ||
.kakaoAccount | ||
?.profile | ||
?.nickName | ||
?.nickname | ||
} | ||
|
||
override fun supports(loginRequestVo: LoginRequestVo) = | ||
loginRequestVo.providerType == ProviderType.KAKAO | ||
override fun supports(providerIdentifier: ProviderIdentifier) = | ||
providerIdentifier.providerType == ProviderType.KAKAO | ||
} |
12 changes: 6 additions & 6 deletions
12
src/main/kotlin/com/poseplz/server/infrastructure/kakao/KakaoUserProfileImageService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package com.poseplz.server.infrastructure.kakao | ||
|
||
import com.poseplz.server.application.auth.LoginRequestVo | ||
import com.poseplz.server.application.auth.ProviderUserProfileImageService | ||
import com.poseplz.server.domain.member.ProviderIdentifier | ||
import com.poseplz.server.domain.member.ProviderType | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class KakaoUserProfileImageService( | ||
private val kakaoApiClient: KakaoApiClient, | ||
private val kakaoAdminApiClient: KakaoAdminApiClient, | ||
) : ProviderUserProfileImageService { | ||
override fun getProviderUserProfileImage(loginRequestVo: LoginRequestVo): String? { | ||
return kakaoApiClient.getKakaoUserInfo(loginRequestVo.providerUserCredential!!) | ||
override fun getProviderUserProfileImage(providerIdentifier: ProviderIdentifier): String? { | ||
return kakaoAdminApiClient.getUserInfo(providerIdentifier.providerUserId) | ||
.kakaoAccount | ||
?.profile | ||
?.profileImageUrl | ||
} | ||
|
||
override fun supports(loginRequestVo: LoginRequestVo) = | ||
loginRequestVo.providerType == ProviderType.KAKAO | ||
override fun supports(providerIdentifier: ProviderIdentifier) = | ||
providerIdentifier.providerType == ProviderType.KAKAO | ||
} |