-
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.
* feat : 닉네임 수정 유스케이스 * feat : 닉네임 수정 API * feat : 닉네임 수정 DTO * feat : 기존 코드 형식 수정
- Loading branch information
1 parent
db85cd0
commit b39cc9d
Showing
10 changed files
with
133 additions
and
37 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
14 changes: 14 additions & 0 deletions
14
adapters/in-web/src/main/kotlin/com/pokit/user/dto/request/ApiUpdateNicknameRequest.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,14 @@ | ||
package com.pokit.user.dto.request | ||
|
||
import jakarta.validation.constraints.NotBlank | ||
import jakarta.validation.constraints.Size | ||
|
||
data class ApiUpdateNicknameRequest( | ||
@field:NotBlank(message = "닉네임은 필수값입니다.") | ||
@field:Size(max = 10, message = "닉네임은 10자 이하만 가능합니다.") | ||
val nickname: String | ||
) | ||
|
||
internal fun ApiUpdateNicknameRequest.toDto() = UpdateNicknameRequest( | ||
nickname = this.nickname | ||
) |
8 changes: 4 additions & 4 deletions
8
application/src/main/kotlin/com/pokit/user/port/in/UserUseCase.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,13 +1,13 @@ | ||
package com.pokit.user.port.`in` | ||
|
||
import com.pokit.user.dto.request.SignUpRequest | ||
import com.pokit.user.dto.response.CheckDuplicateNicknameResponse | ||
import com.pokit.user.dto.response.SignUpResponse | ||
import com.pokit.user.dto.request.UpdateNicknameRequest | ||
import com.pokit.user.model.User | ||
|
||
interface UserUseCase { | ||
fun signUp(user: User, request: SignUpRequest): SignUpResponse | ||
fun signUp(user: User, request: SignUpRequest): User | ||
|
||
fun checkDuplicateNickname(nickname: String): CheckDuplicateNicknameResponse | ||
fun checkDuplicateNickname(nickname: String): Boolean | ||
|
||
fun updateNickname(user: User, request: UpdateNicknameRequest): User | ||
} |
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
5 changes: 5 additions & 0 deletions
5
domain/src/main/kotlin/com/pokit/user/dto/request/UpdateNicknameRequest.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,5 @@ | ||
package com.pokit.user.dto.request | ||
|
||
data class UpdateNicknameRequest( | ||
val nickname: String | ||
) |
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
15 changes: 15 additions & 0 deletions
15
domain/src/main/kotlin/com/pokit/user/dto/response/UserResponse.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,15 @@ | ||
package com.pokit.user.dto.response | ||
|
||
import com.pokit.user.model.User | ||
|
||
data class UserResponse ( | ||
val id: Long, | ||
val email: String, | ||
val nickname: String | ||
) | ||
|
||
fun User.toResponse() = UserResponse( | ||
id = this.id, | ||
email = this.email, | ||
nickname = this.nickName | ||
) |
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