-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π :: (Meogo-20) user my page #21
Conversation
Walkthroughμ΄λ² λ³κ²½ μ¬νμ μ¬μ©μ κ΄λ ¨ λ°μ΄ν°λ₯Ό μ²λ¦¬νκΈ° μν μλ‘μ΄ κΈ°λ₯μ μΆκ°νκ³ , κΈ°μ‘΄ κΈ°λ₯μ λ°ν νμ
μ μμ νλ©°, μ¬μ©μ μ 보λ₯Ό μν μλ΅ κ°μ²΄λ₯Ό μ μνλ κ²μ ν¬ν¨ν©λλ€. Changes
Sequence Diagram(s)sequenceDiagram
participant UserController
participant MyPageService
participant UserFacade
participant MyPageResponse
UserController->>MyPageService: myPage()
MyPageService->>UserFacade: getCurrentUser()
UserFacade-->>MyPageService: User
MyPageService->>MyPageResponse: createResponse(user)
MyPageResponse-->>MyPageService: MyPageResponse
MyPageService-->>UserController: MyPageResponse
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- src/main/kotlin/org/meogo/domain/review/repository/ReviewRepository.kt (2 hunks)
- src/main/kotlin/org/meogo/domain/user/facade/UserFacade.kt (1 hunks)
- src/main/kotlin/org/meogo/domain/user/presentation/UserController.kt (3 hunks)
- src/main/kotlin/org/meogo/domain/user/presentation/dto/response/MyPageResponse.kt (1 hunks)
- src/main/kotlin/org/meogo/domain/user/service/MyPageService.kt (1 hunks)
Files skipped from review due to trivial changes (1)
- src/main/kotlin/org/meogo/domain/user/presentation/dto/response/MyPageResponse.kt
Additional comments not posted (5)
src/main/kotlin/org/meogo/domain/review/repository/ReviewRepository.kt (1)
14-15
: μλ‘μ΄ λ©μλ μΆκ° μΉμΈ
findByUserId
λ©μλλ μ¬μ©μ IDλ‘ λ¦¬λ·°λ₯Ό κ²μνλ κΈ°λ₯μ μΆκ°νμ¬ReviewRepository
μΈν°νμ΄μ€μ κΈ°λ₯μ νμ₯ν©λλ€. μ΄ λ©μλλ UUIDλ₯Ό μ¬μ©νμ¬ μ¬μ©μλ₯Ό μλ³νλ©°, λ¦¬λ·°κ° μλ κ²½μ°λ₯Ό κ³ λ €νμ¬ λ°ν νμ μ΄ nullableμ λλ€.src/main/kotlin/org/meogo/domain/user/presentation/UserController.kt (4)
7-7
: μλ‘μ΄ μλ΅ κ°μ²΄ μΆκ° νμΈ
MyPageResponse
ν΄λμ€κ° μν¬νΈ λμμ΅λλ€. μ΄λ μλ‘μ΄/myPage
μλν¬μΈνΈμμ μ¬μ©μμ λ°μ΄ν°λ₯Ό λ°ννλ λ° μ¬μ©λ©λλ€.
9-9
: μλ‘μ΄ μλΉμ€ μΆκ° νμΈ
MyPageService
μλΉμ€κ° μν¬νΈ λμμ΅λλ€. μ΄ μλΉμ€λ/myPage
μλν¬μΈνΈμμ μ¬μ©μμ μμΈ μ 보λ₯Ό κ°μ Έμ€λ λ° μ¬μ©λ©λλ€.
26-27
: μμ‘΄μ± μ£Όμ νμΈ
UserController
ν΄λμ€μ μμ±μμmyPageService
κ° μΆκ°λμμ΅λλ€. μ΄λ μλ‘μ΄/myPage
μλν¬μΈνΈμ λ‘μ§μ μ²λ¦¬νκΈ° μν΄ νμν©λλ€.
44-46
: μλ‘μ΄ μλν¬μΈνΈ μΆκ° νμΈ
@GetMapping("/myPage")
μ ν΅ν΄ μλ‘μ΄ GET μλν¬μΈνΈκ° μΆκ°λμμ΅λλ€. μ΄ λ©μλλMyPageService
λ₯Ό μ¬μ©νμ¬MyPageResponse
κ°μ²΄λ₯Ό λ°νν©λλ€. μ΄λ μ¬μ©μμ μμΈ μ 보λ₯Ό μ 곡νλ μ€μν κΈ°λ₯μ λλ€.
fun execute(): MyPageResponse { | ||
val user = userFacade.currentUser() ?: throw UserNotFoundException | ||
|
||
return MyPageResponse( | ||
user.name, | ||
user.accountId, | ||
user.profile!! | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
νλ‘ν μ²λ¦¬ λ°©μ κ°μ μ μ
execute
λ©μλμμ user.profile
μ λν non-null assertion (!!
) μ¬μ©μ NullPointerException
μ λ°μμν¬ μνμ΄ μμ΅λλ€. μμ νκ² μ²λ¦¬νκΈ° μν΄ non-null assertion λμ μ μ ν μμΈ μ²λ¦¬λ κΈ°λ³Έκ° μ 곡μ κ³ λ €ν΄μΌ ν©λλ€.
- user.profile!!
+ user.profile ?: throw ProfileNotFoundException("Profile not found")
Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
fun execute(): MyPageResponse { | |
val user = userFacade.currentUser() ?: throw UserNotFoundException | |
return MyPageResponse( | |
user.name, | |
user.accountId, | |
user.profile!! | |
) | |
fun execute(): MyPageResponse { | |
val user = userFacade.currentUser() ?: throw UserNotFoundException | |
return MyPageResponse( | |
user.name, | |
user.accountId, | |
user.profile ?: throw ProfileNotFoundException("Profile not found") | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄κ±΄ λμ€μ s3λ₯Ό λμ ν΄μ profileμ΄ nullμ΄λ©΄ κΈ°λ³Έ μ΄λ―Έμ§λ₯Ό λ°ννλλ‘ ν κ±°μΌ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meltapplee, understood! Your plan to handle null profiles with S3 and return a default image sounds good. Just make sure the current implementation is stable until the S3 integration is in place. If you need any assistance with that in the future, feel free to reach out! π
close #20
Summary by CodeRabbit
μλ‘μ΄ κΈ°λ₯
/myPage
μΆκ°.MyPageResponse
λ°μ΄ν° ν΄λμ€ μΆκ°.MyPageService
μλΉμ€ ν΄λμ€ μΆκ°.λ²κ·Έ μμ
currentUser()
ν¨μμ λ°ν νμ μ λ³κ²½νμ¬ null μμ μ±μ κ°ν.