-
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.
[YS-264] �feat: 회원 정보 수정 기능을 위한 contactEmail 검증 API 및 로직 추가 (#81)
* feat: add contactEmail validation logic to the existing member update feature. * refactor: add contactEmail field to MemberResponse * refactor: add contactEmail field to MemberResponse * fix: exclude user's existing email from duplicate validation * feat: add validateContactEmailForUpdate * test: add ValidateContactEmailForUpdateUseCaseTest * refactor: refactor URIs for consistency * refactor: change parameter name * refactor: rename validate to validation in URI
- Loading branch information
Showing
22 changed files
with
375 additions
and
47 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
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
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
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
27 changes: 27 additions & 0 deletions
27
...tlin/com/dobby/backend/application/usecase/member/ValidateContactEmailForUpdateUseCase.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.dobby.backend.application.usecase.member | ||
|
||
import com.dobby.backend.application.usecase.UseCase | ||
import com.dobby.backend.domain.gateway.member.MemberGateway | ||
|
||
class ValidateContactEmailForUpdateUseCase( | ||
private val memberGateway: MemberGateway | ||
) : UseCase<ValidateContactEmailForUpdateUseCase.Input, ValidateContactEmailForUpdateUseCase.Output> { | ||
data class Input( | ||
val memberId: String, | ||
val contactEmail: String | ||
) | ||
|
||
data class Output( | ||
val isDuplicate: Boolean | ||
) | ||
|
||
override fun execute(input: Input): Output { | ||
val currentContactEmail = memberGateway.findContactEmailByMemberId(input.memberId) | ||
if (currentContactEmail == input.contactEmail) { | ||
return Output(false) | ||
} | ||
|
||
val isDuplicate = memberGateway.existsByContactEmail(input.contactEmail) | ||
return Output(isDuplicate) | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,4 @@ data class OauthLoginResponse( | |
|
||
@Schema(description = "사용자 정보") | ||
val memberInfo: MemberResponse | ||
) { | ||
} | ||
) |
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 |
---|---|---|
|
@@ -19,6 +19,9 @@ data class MemberResponse( | |
@Schema(description = "OAuth 제공자", example = "GOOGLE") | ||
val provider: ProviderType?, | ||
|
||
@Schema(description = "연락받을 이메일", example = "[email protected]") | ||
val contactEmail: String?, | ||
|
||
@Schema(description = "역할", example = "RESEARCHER") | ||
val role: RoleType?, | ||
) { | ||
|
@@ -29,6 +32,7 @@ data class MemberResponse( | |
memberId = id, | ||
oauthEmail = oauthEmail, | ||
provider = provider, | ||
contactEmail = contactEmail, | ||
role = role, | ||
name = name | ||
) | ||
|
Oops, something went wrong.