-
Notifications
You must be signed in to change notification settings - Fork 1
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
π :: (PiCK-252)upload profile api #257
Conversation
Walkthroughμ΄λ² λ³κ²½μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μ
λ‘λνκ³ κ΄λ¦¬νλ κΈ°λ₯μ μΆκ°νμ¬, μ¬μ©μ λ°μ΄ν° μ²λ¦¬λ₯Ό κ°μ νλ λ° μ€μ μ λμμ΅λλ€. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UserController
participant UploadUserProfileService
participant FileUtil
User->>UserController: νλ‘ν μ΄λ―Έμ§ μ
λ‘λ μμ²
UserController->>UploadUserProfileService: uploadUserProfile(file)
UploadUserProfileService->>FileUtil: κΈ°μ‘΄ νλ‘ν μ΄λ―Έμ§ μμ
UploadUserProfileService->>FileUtil: μ νλ‘ν μ΄λ―Έμ§ μ
λ‘λ
UploadUserProfileService->>UploadUserProfileService: μ¬μ©μ νλ‘ν μ
λ°μ΄νΈ
UploadUserProfileService-->>UserController: μλ΅
UserController-->>User: μ
λ‘λ κ²°κ³Ό λ°ν
Assessment against linked issues
Poem
π Recent review detailsConfiguration used: CodeRabbit UI π Files selected for processing (2)
π§ Files skipped from review as they are similar to previous changes (2)
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: 0
Outside diff range, codebase verification and nitpick comments (3)
src/main/kotlin/dsm/pick2024/domain/user/port/in/UploadUserProfileUseCase.kt (1)
5-7
: μΈν°νμ΄μ€μ λ¬Έμ μ£Όμμ μΆκ°νμΈμ.
UploadUserProfileUseCase
μΈν°νμ΄μ€μuploadUserProfile
λ©μλμ λν λ¬Έμ μ£Όμμ΄ νμν©λλ€. μ΄λ μ½λμ κ°λ μ±κ³Ό μ μ§λ³΄μμ±μ ν₯μμν΅λλ€./** * Interface for uploading user profile images. */ interface UploadUserProfileUseCase { /** * Uploads a user profile image. * * @param file the profile image file to upload */ fun uploadUserProfile(file: MultipartFile) }src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (1)
21-21
:fileUtil
import λλ½ νμΈ
fileUtil.generateObjectUrl
ν¨μκ° μ¬μ©λ μλ νμΌλ€μμfileUtil
μ import λ¬Έμ΄ λλ½λμμ΅λλ€. μ΄λ‘ μΈν΄ μ½λκ° μ¬λ°λ₯΄κ² μ»΄νμΌλμ§ μκ±°λ μλνμ§ μμ μ μμ΅λλ€.fileUtil
μ μ¬λ°λ₯΄κ² import ν΄ μ£ΌμΈμ.
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt
src/main/kotlin/dsm/pick2024/domain/bug/AddBugService.kt
src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt
Analysis chain
νλ‘ν URL μμ± λ‘μ§ νμΈ
fileUtil
μ μ¬μ©νμ¬ νλ‘ν URLμ μμ±νλ λ‘μ§μ΄ μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό λ ν¨μ¨μ μΌλ‘ μ²λ¦¬ν©λλ€.κ·Έλ¬λ,
fileUtil
μ μ¬μ©μ΄ μ¬λ°λ₯΄κ² μ μ©λμλμ§ νμΈν΄ μ£ΌμΈμ.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `fileUtil.generateObjectUrl`. # Test: Search for the function usage. Expect: Only occurrences of the new usage. rg --type kotlin -A 5 $'fileUtil.generateObjectUrl'Length of output: 2598
Script:
#!/bin/bash # Description: Verify the import of `fileUtil` in the identified files. # Test: Check for the import statements of `fileUtil` in the identified files. files=( "src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt" "src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt" "src/main/kotlin/dsm/pick2024/domain/bug/AddBugService.kt" "src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt" ) for file in "${files[@]}"; do echo "File: $file" rg --type kotlin "import .*fileUtil" "$file" echo doneLength of output: 1605
src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt (1)
106-107
: μλν¬μΈνΈ ꡬν λλ½ νμΈ
/user/profile
μλν¬μΈνΈκ° 보μ μ€μ μ μΆκ°λμμΌλ, μ€μ λ‘ μ΄λ₯Ό μ²λ¦¬νλ 컨νΈλ‘€λ¬λ μλΉμ€ λ©μλκ° κ΅¬νλμ§ μμ κ²μΌλ‘ 보μ λλ€. μ΄λ‘ μΈν΄ ν΄λΉ μλν¬μΈνΈκ° μ μμ μΌλ‘ μλνμ§ μμ μ μμ΅λλ€.
SecurityConfig.kt
νμΌμμ/user/profile
μλν¬μΈνΈκ° 보νΈλκ³ μλ κ²μ νμΈνμ΅λλ€.- κ·Έλ¬λ, μ΄ μλν¬μΈνΈλ₯Ό μ²λ¦¬νλ 컨νΈλ‘€λ¬λ μλΉμ€ λ©μλκ° μ½λλ² μ΄μ€μ μ‘΄μ¬νμ§ μμ΅λλ€.
μλν¬μΈνΈμ κΈ°λ₯μ ꡬννμ¬ μμλλ‘ μλνλλ‘ νλ κ²μ΄ νμν©λλ€.
Analysis chain
μλ‘μ΄ μλν¬μΈνΈ μΆκ° νμΈ
/user/profile
μλν¬μΈνΈκ°Role.STU
μν μ μꡬνλ κ²½λ‘ λͺ©λ‘μ μΆκ°λμμ΅λλ€. μ΄λ μ¬μ©μ νλ‘ν μ 보μ λν μ κ·Όμ μ ννλ €λ μλμ μΌμΉν©λλ€.κ·Έλ¬λ, μ΄ μλν¬μΈνΈμ κΈ°λ₯μ΄ μμλλ‘ μλνλμ§ νμΈνλ κ²μ΄ μ€μν©λλ€.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the functionality of the new endpoint `/user/profile`. # Test: Ensure the endpoint is protected and accessible only by users with the `Role.STU` role. rg --type kotlin -A 5 $'"/user/profile"'Length of output: 653
Script:
#!/bin/bash # Description: Search for the implementation details of the `/user/profile` endpoint. # Find the controller or service methods handling the `/user/profile` endpoint. rg --type kotlin '"/user/profile"'Length of output: 138
Script:
#!/bin/bash # Description: Search for the implementation details of the `/user/profile` endpoint across all Kotlin files. # Find the controller or service methods handling the `/user/profile` endpoint. rg --type kotlin 'user/profile'Length of output: 133
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- src/main/kotlin/dsm/pick2024/domain/application/presentation/dto/response/QueryMyApplicationResponse.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/port/in/UploadUserProfileUseCase.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/presentation/UserController.kt (3 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/infrastructure/s3/PathList.kt (1 hunks)
Files skipped from review due to trivial changes (1)
- src/main/kotlin/dsm/pick2024/infrastructure/s3/PathList.kt
Additional comments not posted (12)
src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt (1)
4-4
: λ³κ²½ μ¬ν μΉμΈλ¨
QueryUserSimpleInfoResponse
λ°μ΄ν° ν΄λμ€μprofile
μμ±μ μΆκ°ν κ²μ μ μ°μ±μ λμ΄κ³ μ¬μ©μ μ 보λ₯Ό λ μ μ λ¬ν μ μκ² ν©λλ€.src/main/kotlin/dsm/pick2024/domain/application/presentation/dto/response/QueryMyApplicationResponse.kt (1)
15-15
: λ³κ²½ μ¬ν μΉμΈλ¨
QueryMyApplicationResponse
λ°μ΄ν° ν΄λμ€μprofile
μμ±μ μΆκ°ν κ²μ μλ΅ λ°μ΄ν° ꡬ쑰μ μ μ°μ±μ λμ΄κ³ μΆκ°μ μΈ μ¬μ©μ μ 보λ₯Ό μ 곡ν μ μκ² ν©λλ€.src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt (1)
21-23
: μλ‘μ΄ λ©μλ μΆκ°:updateProfileFileName
μ΄ λ©μλλ
User
ν΄λμ€μprofile
μμ±μ μ λ°μ΄νΈνλ©΄μ λΆλ³μ±μ μ μ§ν©λλ€. μ½λκ° λͺ ννκ³ μ½νλ¦°μ λͺ¨λ² μ¬λ‘λ₯Ό λ°λ¦ λλ€.src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt (3)
6-7
: μλ‘μ΄ μμ‘΄μ± μΆκ°:FileUtil
FileUtil
μ νμ©νμ¬ νμΌ μ²λ¦¬λ₯Ό μν κΈ°λ₯μ΄ μΆκ°λμμ΅λλ€.
13-14
: μμ±μ μ λ°μ΄νΈ:FileUtil
μμ‘΄μ± μ£Όμ
FileUtil
μ μμ±μμ μΆκ°νμ¬ νμΌ μ²λ¦¬λ₯Ό μν μμ‘΄μ±μ μ£Όμ ν©λλ€.
20-26
: λ©μλ μ λ°μ΄νΈ:queryUserSimpleInfo
μ¬μ©μμ νλ‘ν μ΄λ―Έμ§ URLμ μμ±νκ³ μλ΅μ ν¬ν¨μν€λ λ‘μ§μ΄ μΆκ°λμμ΅λλ€. μ΄λ μλΉμ€μ κΈ°λ₯μ ν₯μμν΅λλ€.
src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt (1)
1-28
: μλ‘μ΄ μλΉμ€ ν΄λμ€ μΆκ°:UploadUserProfileService
μ΄ ν΄λμ€λ νλ‘ν μ΄λ―Έμ§ μ λ‘λλ₯Ό μ²λ¦¬νλ κΈ°λ₯μ ν¬ν¨νκ³ μμ΅λλ€. μ½λ κ΅¬μ‘°κ° μ λμ΄ μμΌλ©° λͺ¨λ² μ¬λ‘λ₯Ό λ°λ¦ λλ€.
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (1)
13-14
: μμ‘΄μ± μΆκ° νμΈ
fileUtil
μμ‘΄μ±μ΄ μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μν URL μμ±μ κ°λ₯νκ² ν©λλ€.src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2)
18-19
: μμ‘΄μ± μΆκ° νμΈ
fileUtil
μμ‘΄μ±μ΄ μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μν URL μμ±μ κ°λ₯νκ² ν©λλ€.
39-39
: νλ‘ν URL μμ± λ‘μ§ νμΈ
fileUtil
μ μ¬μ©νμ¬ νλ‘ν URLμ μμ±νλ λ‘μ§μ΄ μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό λ ν¨μ¨μ μΌλ‘ μ²λ¦¬ν©λλ€.κ·Έλ¬λ,
fileUtil
μ μ¬μ©μ΄ μ¬λ°λ₯΄κ² μ μ©λμλμ§ νμΈν΄ μ£ΌμΈμ.Verification successful
νλ‘ν URL μμ± λ‘μ§ νμΈ μλ£
fileUtil.generateObjectUrl
ν¨μκ° μ¬λ¬ νμΌμμ μΌκ΄λκ² μ¬μ©λκ³ μμ΅λλ€. μ΄λ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ λ° κΈ°ν νμΌμ μ²λ¦¬νλ νμ€ μ κ·Ό λ°©μμ λνλ λλ€. λ°λΌμ, ν΄λΉ ν¨μμ μ¬μ©μ΄ μ¬λ°λ₯΄κ² μ μ©λμμμ νμΈνμ΅λλ€.
QueryUserSimpleInfoService.kt
QueryUserDetaileInfoService.kt
AddBugService.kt
QueryMyApplicationService.kt
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `fileUtil.generateObjectUrl`. # Test: Search for the function usage. Expect: Only occurrences of the new usage. rg --type kotlin -A 5 $'fileUtil.generateObjectUrl'Length of output: 2598
src/main/kotlin/dsm/pick2024/domain/user/presentation/UserController.kt (2)
32-33
: μμ‘΄μ± μΆκ° νμΈ
uploadUserProfileUseCase
μμ‘΄μ±μ΄ μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ λ‘λλ₯Ό μ²λ¦¬νλ κΈ°λ₯μ κ°λ₯νκ² ν©λλ€.
59-60
: νλ‘ν μ λ‘λ μλν¬μΈνΈ μΆκ° νμΈμ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μ λ‘λνλ μλ‘μ΄ μλν¬μΈνΈκ° μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν κ΄λ¦¬λ₯Ό ν₯μμν΅λλ€.
κ·Έλ¬λ,
uploadUserProfileUseCase
μ μ¬μ©μ΄ μ¬λ°λ₯΄κ² μ μ©λμλμ§ νμΈν΄ μ£ΌμΈμ.Verification successful
νλ‘ν μ λ‘λ μλν¬μΈνΈ μΆκ° νμΈ
μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μ λ‘λνλ μλ‘μ΄ μλν¬μΈνΈκ° μΆκ°λμμ΅λλ€. μ΄ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν κ΄λ¦¬λ₯Ό ν₯μμν΅λλ€.
λν,
uploadUserProfileUseCase
μ μ¬μ©μ΄ μ¬λ°λ₯΄κ² μ μ©λμμμ νμΈνμ΅λλ€.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `uploadUserProfileUseCase.uploadUserProfile`. # Test: Search for the function usage. Expect: Only occurrences of the new usage. rg --type kotlin -A 5 $'uploadUserProfileUseCase.uploadUserProfile'Length of output: 320
src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt
Outdated
Show resolved
Hide resolved
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: 1
π§Ή Outside diff range and nitpick comments (7)
src/main/kotlin/dsm/pick2024/infrastructure/s3/PathList.kt (1)
5-5
: LGTM! νλ‘ν κ²½λ‘ μμκ° μΆκ°λμμ΅λλ€.μλ‘μ΄
PROFILE
μμκ° μ μ νκ² μΆκ°λμμ΅λλ€. μ΄λ κΈ°μ‘΄ μμλ€κ³Ό μΌκ΄λ λͺ λͺ κ·μΉκ³Ό κ° νμμ λ°λ₯΄κ³ μμ΄ μ’μ΅λλ€.μ½λμ κ°λ μ±κ³Ό μ μ§λ³΄μμ±μ λμ± ν₯μμν€κΈ° μν΄, κ° μμμ λν κ°λ¨ν μ£Όμμ μΆκ°νλ κ²μ κ³ λ €ν΄λ³΄μλ κ²μ μ΄λ¨κΉμ? μλ₯Ό λ€μ΄:
/** νλ‘ν μ΄λ―Έμ§ μ μ₯ κ²½λ‘ */ const val PROFILE = "PROFILE/"src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt (1)
7-8
: νλ‘ν μ΄λ―Έμ§ URLμ μν μμ± μΆκ° μΉμΈμλ‘μ΄
profile
μμ±μ μΆκ°λ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ κΈ°λ₯ ꡬνμ μν μ’μ μ κ·Ό λ°©μμ λλ€. nullable νμ κ³Ό κΈ°λ³Έκ° null μ¬μ©μ μ΄μ λ²μ κ³Όμ νΈνμ±μ μ μ§νλ©΄μ νλ‘ν μ΄λ―Έμ§κ° μλ μ¬μ©μλ₯Ό μ²λ¦¬ν μ μκ² ν΄μ€λλ€.λ λͺ νν μλ―Έ μ λ¬μ μν΄
profile
λμprofileImageUrl
κ³Ό κ°μ λ ꡬ체μ μΈ μ΄λ¦μ μ¬μ©νλ κ²μ΄ μ΄λ¨κΉμ? μ΄λ κ² νλ©΄ μ΄ μμ±μ΄ μ νν 무μμ λνλ΄λμ§ λ λͺ νν΄μ§ κ² κ°μ΅λλ€.data class QueryUserSimpleInfoResponse( val userName: String, val grade: Int, val classNum: Int, val num: Int, - val profile: String? = null, + val profileImageUrl: String? = null, )src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt (1)
23-25
: μ’μ ꡬνμ λλ€. μ½κ°μ κ°μ μ μμ΄ μμ΅λλ€.
updateProfileFileName
λ©μλμ ꡬνμ΄ μ λμμ΅λλ€. λΆλ³μ±μ μ μ§νλ©΄μ νλ‘ν νμΌ μ΄λ¦μ μ λ°μ΄νΈνλ λ°©μμ΄ μ μ ν©λλ€. λ€λ§, λ λμ null μμ μ±μ μν΄ λ€μκ³Ό κ°μ μμ κ°μ μ μ μν©λλ€:fun updateProfileFileName(fileName: String?): User { - return this.copy(profile = fileName) + return this.copy(profile = fileName?.takeIf { it.isNotBlank() }) }μ΄λ κ² νλ©΄ λΉ λ¬Έμμ΄μ΄ λ€μ΄μμ λλ
null
λ‘ μ²λ¦¬λμ΄ λ μμ ν μ½λκ° λ©λλ€.src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (2)
13-14
: μμ±μ λ³κ²½μ΄ μ μ ν μ΄λ£¨μ΄μ‘μ΅λλ€.
FileUtil
μ μμ‘΄μ±μΌλ‘ μΆκ°ν κ²μ νλ‘ν μ΄λ―Έμ§ URL μμ± κΈ°λ₯ ꡬνμ νμν μ’μ λ³κ²½μ¬νμ λλ€. μ΄λ μμ‘΄μ± μ£Όμ ν¨ν΄μ λ°λ₯΄κ³ μμ΄ ν μ€νΈ μ©μ΄μ±κ³Ό μ μ°μ±μ λμ λλ€.κ°λ μ±μ λμ΄κΈ° μν΄ κ° λ§€κ°λ³μλ₯Ό λ³λμ μ€μ λ°°μΉνλ κ²μ κ³ λ €ν΄ λ³΄μΈμ. μλ₯Ό λ€λ©΄:
class QueryUserDetaileInfoService( private val userFacadeUseCase: UserFacadeUseCase, private val fileUtil: FileUtil ) : QueryUserDetailsInfoUseCase { // ... }
21-21
:queryUserDetailsInfo
λ©μλμ λ³κ²½μ΄ μ μ ν μ΄λ£¨μ΄μ‘μ΅λλ€.νλ‘ν μ΄λ―Έμ§ URL μμ±μ μν΄
fileUtil.generateObjectUrl
μ μ¬μ©ν κ²μ μ’μ λ³κ²½μ¬νμ λλ€. null μμ νΈμΆμ μ¬μ©νμ¬ μ μ¬μ μΈ null κ°μ μ²λ¦¬ν κ²λ νλ₯ν©λλ€.μ½λμ κ°λ μ±μ λμ΄κΈ° μν΄ λ€μκ³Ό κ°μ΄ λ³κ²½μ κ³ λ €ν΄ λ³΄μΈμ:
profile = user.profile?.let { profile -> fileUtil.generateObjectUrl(profile, PathList.PROFILE) },μ΄λ κ² νλ©΄
it
μ μλ―Έκ° λ λͺ νν΄μ§κ³ , μ½λμ μλλ₯Ό λ μ μ λ¬ν μ μμ΅λλ€.src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2)
19-20
: μμ±μμ μλ‘μ΄ μμ‘΄μ±μ΄ μ μ ν μΆκ°λμμ΅λλ€.
FileUtil
μ μμ±μ 맀κ°λ³μλ‘ μΆκ°ν κ²μ μλ‘μ΄ κΈ°λ₯ ꡬνμ νμν μ μ ν λ³κ²½μ¬νμ λλ€. λ€λ§, μμ‘΄μ± μ£Όμ μ μΌκ΄μ±μ μν΄private val
ν€μλλ₯Ό μ¬μ©νλ κ²μ΄ μ’μ΅λλ€.λ€μκ³Ό κ°μ΄ μμ νλ κ²μ κ³ λ €ν΄λ³΄μΈμ:
-private val queryApplicationPort: QueryApplicationPort, -fileUtil: FileUtil +private val queryApplicationPort: QueryApplicationPort, +private val fileUtil: FileUtil
42-42
: νλ‘ν URL μμ± λ‘μ§μ΄ μ μ ν μΆκ°λμμ΅λλ€.μ¬μ©μ νλ‘ν μ΄λ―Έμ§ URLμ μμ±νλ λ‘μ§μ΄ μ ꡬνλμμ΅λλ€. null μμ νΈμΆ μ°μ°μ
?.
λ₯Ό μ¬μ©νμ¬ νλ‘νμ΄ μ‘΄μ¬ν λλ§ URLμ μμ±νλ κ²μ μ’μ λ°©μμ λλ€.μ½λμ κ°λ μ±μ λμ΄κΈ° μν΄ λ€μκ³Ό κ°μ΄ μμ νλ κ²μ κ³ λ €ν΄λ³΄μΈμ:
-profile = user.profile?.let { fileUtil.generateObjectUrl(it, PathList.PROFILE) } +profile = user.profile?.let { profile -> fileUtil.generateObjectUrl(profile, PathList.PROFILE) }μ΄λ κ² νλ©΄
it
μ μλ―Έκ° λ λͺ νν΄μ§λλ€.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (6)
- src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/infrastructure/s3/PathList.kt (1 hunks)
π§° Additional context used
π Additional comments (6)
src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserDetaileInfoService.kt (2)
6-7
: μλ‘μ΄ import λ¬Έμ΄ μ μ ν μΆκ°λμμ΅λλ€.
FileUtil
κ³ΌPathList
μ importκ° μΆκ°λμ΄ ν΄λμ€μ μλ‘μ΄ κΈ°λ₯μ μ§μν©λλ€. μ΄λ νλ‘ν μ΄λ―Έμ§ URL μμ± κΈ°λ₯ ꡬνμ νμν λ³κ²½μ¬νμ λλ€.
Line range hint
1-30
: μ λ°μ μΈ λ³κ²½ μ¬νμ΄ PR λͺ©νμ μΌμΉν©λλ€.μ΄ PRμ λ³κ²½ μ¬νμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ μ λ‘λ κΈ°λ₯ ꡬνμ΄λΌλ λͺ©νλ₯Ό μ λ¬μ±νκ³ μμ΅λλ€.
FileUtil
μ ν΅ν©νμ¬ νλ‘ν μ΄λ―Έμ§ URLμ μμ±νλ κΈ°λ₯μ΄ μΆκ°λμκ³ , μ΄λ #252 μ΄μμμ μꡬνλ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ κΈ°λ₯μ μ§μν©λλ€.μ£Όμ λ³κ²½ μ¬ν:
FileUtil
μμ‘΄μ± μΆκ°- νλ‘ν μ΄λ―Έμ§ URL μμ± λ‘μ§ κ΅¬ν
μ΄λ¬ν λ³κ²½μΌλ‘ μ¬μ©μ κ²½νμ΄ ν₯μλκ³ APIμ μ μ°μ±μ΄ λμμ§ κ²μΌλ‘ μμλ©λλ€. μ½λλ μ λ°μ μΌλ‘ μ ꡬ쑰νλμ΄ μμΌλ©°, λͺ κ°μ§ minorν κ°μ μ μμ μ μΈνλ©΄ ν° λ¬Έμ μ μ μμ΅λλ€.
src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2)
11-12
: μλ‘μ΄ import λ¬Έμ΄ μ μ ν μΆκ°λμμ΅λλ€.
FileUtil
κ³ΌPathList
λ₯Ό importνλ κ²μ μλ‘μ΄ κΈ°λ₯ ꡬνμ νμν μ μ ν λ³κ²½μ¬νμ λλ€. μ΄λ μ½λμ κ°λ μ±κ³Ό ꡬ쑰λ₯Ό κ°μ νλ λ° λμμ΄ λ©λλ€.
Line range hint
1-48
: μ λ°μ μΈ λ³κ²½μ¬νμ΄ PRμ λͺ©μ μ λΆν©νλ©° μ ꡬνλμμ΅λλ€.μ΄ PRμ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ μ λ‘λ APIλ₯Ό ꡬννλ λ° μ±κ³΅μ μΌλ‘ κΈ°μ¬νμ΅λλ€. μ½λ λ³κ²½μ¬νμ λͺ ννκ³ μΌκ΄μ± μκ² μ μ©λμμΌλ©°, μλ‘μ΄ κΈ°λ₯μ ν¨κ³Όμ μΌλ‘ ν΅ν©νμ΅λλ€. μ μλ minor κ°μ μ¬νλ€μ κ³ λ €ν΄ λ³΄μκΈ° λ°λλλ€.
λ€μ μ€ν¬λ¦½νΈλ₯Ό μ€ννμ¬
FileUtil
κ³ΌPathList
μ μ¬μ©μ΄ μΌκ΄λκ² μ μ©λμλμ§ νμΈν΄λ³΄μΈμ:β Verification successful
νμΈ μλ£: FileUtil λ° PathList μ¬μ© μΌκ΄μ±
PRμ λ³κ²½μ¬νμ΄ μ½λλ² μ΄μ€ μ λ°μ κ±Έμ³ μΌκ΄λκ² μ μ©λμμμ νμΈνμ΅λλ€. μΆκ°μ μΈ λ¬Έμ κ° λ°κ²¬λμ§ μμμ΅λλ€.
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # FileUtilκ³Ό PathListμ μ¬μ©μ νμΈν©λλ€. echo "Checking FileUtil usage:" rg --type kotlin "FileUtil" -A 5 echo "\nChecking PathList usage:" rg --type kotlin "PathList" -A 5Length of output: 25693
src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt (2)
Line range hint
121-134
: νμ κΆνμ λν GET μλν¬μΈνΈ μΆκ° μΉμΈνμ μν (Role.STU)μ λν GET μμ² μλν¬μΈνΈ μΆκ°κ° μ μ ν΄ λ³΄μ λλ€. μ΄λ νμλ€μ΄ νμν μ 보μ μ κ·Όν μ μλλ‘ νλ λ° λμμ΄ λ κ²μ λλ€.
λ€λ§, "/notification/**" μλν¬μΈνΈλ μ¬μ ν λ무 κ΄λ²μν μ μμ΅λλ€. λ€μκ³Ό κ°μ΄ λ ꡬ체μ μΈ μλν¬μΈνΈλ₯Ό κ³ λ €ν΄ λ³΄μΈμ:
"/notification/my/**"
μ΄λ κ² νλ©΄ νμλ€μ΄ μμ μ μλ¦Όλ§ λ³Ό μ μλλ‘ μ νν μ μμ΅λλ€.
Line range hint
135-149
: μλ‘μ΄ μλν¬μΈνΈ μΆκ°μ λν μΉμΈ λ° λ³΄μ κ°ν μ μνμ(Role.STU)μ μν DELETE μλν¬μΈνΈμ κ΅μ§μ(Role.SCH)μ μν GET μλν¬μΈνΈ μΆκ°κ° μ μ ν΄ λ³΄μ λλ€.
κ·Έλ¬λ "/weekend-meal/excel" λ° "/weekend-meal/excel/grade"μ κ°μ μλν¬μΈνΈλ λλμ λ°μ΄ν°λ₯Ό λ€λ£° μ μμΌλ―λ‘, μΆκ°μ μΈ λ³΄μ μ‘°μΉλ₯Ό κ³ λ €ν΄ λ³΄μκΈ° λ°λλλ€. μλ₯Ό λ€μ΄:
- μμ² λΉλ μ ν (Rate limiting) ꡬν
- λ°μ΄ν° μνΈν
- λ‘κΉ κ°ν
λν, μ΄λ¬ν μλν¬μΈνΈμ λν μ κ·Όμ νΉμ κ΄λ¦¬μ μν λ‘ λμ± μ ννλ κ²λ κ³ λ €ν΄ λ³Ό μ μμ΅λλ€.
src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt
Outdated
Show resolved
Hide resolved
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: 4
π§Ή Outside diff range and nitpick comments (4)
src/main/kotlin/dsm/pick2024/domain/user/port/in/ModifyProfileUseCase.kt (1)
1-7
: μΈν°νμ΄μ€ κ΅¬μ‘°κ° μ μ€κ³λμμ΅λλ€.Clean Architecture ν¨ν΄μ λ°λ₯΄λ μ’μ μΈν°νμ΄μ€ μ€κ³μ λλ€. νμ§λ§ λͺ κ°μ§ κ°μ ν μ μ΄ μμ΅λλ€:
modifyProfile
λ©μλμ λ°ν νμ μ μΆκ°νλ κ²μ΄ μ’μ΅λλ€. μλ₯Ό λ€μ΄, μ λ°μ΄νΈλ νλ‘ν URLμ λ°ννκ±°λ μ±κ³΅/μ€ν¨ μ¬λΆλ₯Ό λνλ΄λ λΆλ¦¬μΈ κ°μ λ°νν μ μμ΅λλ€.μΈν°νμ΄μ€μ λ©μλμ KDoc λ¬Έμλ₯Ό μΆκ°νμ¬ μ¬μ© λͺ©μ κ³Ό 맀κ°λ³μμ λν μ€λͺ μ μ 곡νλ κ²μ΄ μ’μ΅λλ€.
λ€μκ³Ό κ°μ΄ μμ νλ κ²μ μ μν©λλ€:
package dsm.pick2024.domain.user.port.`in` import org.springframework.web.multipart.MultipartFile +/** + * μ¬μ©μ νλ‘ν μμ μ μν μ μ€μΌμ΄μ€ μΈν°νμ΄μ€ + */ interface ModifyProfileUseCase { + /** + * μ¬μ©μ νλ‘ν μ΄λ―Έμ§λ₯Ό μμ ν©λλ€. + * + * @param multipartFile μ λ‘λν νλ‘ν μ΄λ―Έμ§ νμΌ + * @return μ λ°μ΄νΈλ νλ‘ν μ΄λ―Έμ§ URL + */ - fun modifyProfile(multipartFile: MultipartFile) + fun modifyProfile(multipartFile: MultipartFile): String }src/main/kotlin/dsm/pick2024/domain/user/presentation/UserController.kt (2)
22-22
: import λ¬Έ μΆκ°λ μ μ νλ, μμ μ‘°μ μ΄ νμν μ μμ΅λλ€.
MultipartFile
μ μν import λ¬Έμ΄ μ¬λ°λ₯΄κ² μΆκ°λμμ΅λλ€. μ΄λ νμΌ μ λ‘λ μ²λ¦¬μ νμν©λλ€. λ€λ§, κΈ°μ‘΄ import λ¬Έμ μμμ μΌκ΄μ±μ μ μ§νκΈ° μν΄ μμΉλ₯Ό μ‘°μ νλ κ²μ΄ μ’μ μ μμ΅λλ€.import λ¬Έμ μνλ²³ μμλ‘ μ λ ¬νκ±°λ, κΈ°μ‘΄μ κ·Έλ£Ήν λ°©μμ λ°λΌ μ μ ν μμΉλ‘ μ΄λνλ κ²μ κ³ λ €ν΄λ³΄μΈμ.
59-61
: μλ‘μ΄ λ©μλκ° μΆκ°λμμ§λ§, λͺ κ°μ§ κ°μ μ΄ νμν©λλ€.νλ‘ν μ λ‘λλ₯Ό μν μ μλν¬μΈνΈκ° μ¬λ°λ₯΄κ² μΆκ°λμμ΅λλ€. κ·Έλ¬λ λ€μ μ¬νλ€μ κ³ λ €ν΄ λ³΄μκΈ° λ°λλλ€:
- λ©μλ μ΄λ¦: "upload"λ λ€μ μΌλ°μ μ λλ€. "uploadUserProfile"κ³Ό κ°μ΄ λ ꡬ체μ μΈ μ΄λ¦μ μ¬μ©νλ κ²μ΄ μ’μ΅λλ€.
- μ€λ₯ μ²λ¦¬: νμΌ μ λ‘λ μ€ν¨ μ μμΈ μ²λ¦¬κ° νμν μ μμ΅λλ€.
- μ λ ₯ μ ν¨μ± κ²μ¬: νμΌ ν¬κΈ°, νμ λ±μ λν κ²μ¦μ΄ νμν μ μμ΅λλ€.
λ€μκ³Ό κ°μ΄ λ©μλλ₯Ό κ°μ ν΄ λ³΄μΈμ:
@Operation(summary = "μ μ νλ‘ν μ λ‘λ API") @PatchMapping("/profile") fun uploadUserProfile(@RequestParam("file") file: MultipartFile): ResponseEntity<String> { return try { // νμΌ μ ν¨μ± κ²μ¬ if (file.isEmpty) { return ResponseEntity.badRequest().body("νμΌμ΄ λΉμ΄ μμ΅λλ€.") } if (!file.contentType?.startsWith("image/") == true) { return ResponseEntity.badRequest().body("μ΄λ―Έμ§ νμΌλ§ μ λ‘λ κ°λ₯ν©λλ€.") } // μ΅λ νμΌ ν¬κΈ° κ²μ¬ (μ: 5MB) if (file.size > 5 * 1024 * 1024) { return ResponseEntity.badRequest().body("νμΌ ν¬κΈ°λ 5MBλ₯Ό μ΄κ³Όν μ μμ΅λλ€.") } val result = uploadUserProfileUseCase.uploadUserProfile(file) ResponseEntity.ok(result) } catch (e: Exception) { ResponseEntity.internalServerError().body("νλ‘ν μ λ‘λ μ€ μ€λ₯κ° λ°μνμ΅λλ€: ${e.message}") } }μ΄ κ°μ λ λ²μ μ λ λͺ νν λ©μλ μ΄λ¦μ μ¬μ©νκ³ , κΈ°λ³Έμ μΈ νμΌ μ ν¨μ± κ²μ¬μ μ€λ₯ μ²λ¦¬λ₯Ό ν¬ν¨νκ³ μμ΅λλ€.
src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt (1)
19-19
:@Transactional
μ΄λ Έν μ΄μ μ μ μ© μμΉ νμΈ
@Transactional
μ΄λ Έν μ΄μ μ ν΄λμ€ λ 벨μ μ μ©νλ©΄ μ½λκ° λ κΉλν΄μ§ μ μμ΅λλ€. λλ, μ½κΈ° μ μ© νΈλμμ κ³Ό μ°κΈ° νΈλμμ μ ꡬλΆνκΈ° μν΄ λ©μλλ³λ‘ μΈλΆνν μλ μμ΅λλ€.μμ:
+@Transactional @Service class UploadUserProfileService( // κΈ°μ‘΄ μ½λ μ μ§ ) : UploadUserProfileUseCase {
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (10)
- src/main/kotlin/dsm/pick2024/domain/application/presentation/dto/response/QueryMyApplicationResponse.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt (2 hunks)
- src/main/kotlin/dsm/pick2024/domain/attendance/service/ChangeAllAttendanceService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/meal/service/SaveMealService.kt (0 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/port/in/ModifyProfileUseCase.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/presentation/UserController.kt (3 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt (1 hunks)
- src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt (1 hunks)
π€ Files with no reviewable changes (1)
- src/main/kotlin/dsm/pick2024/domain/meal/service/SaveMealService.kt
β Files skipped from review due to trivial changes (1)
- src/main/kotlin/dsm/pick2024/domain/attendance/service/ChangeAllAttendanceService.kt
π§ Files skipped from review as they are similar to previous changes (3)
- src/main/kotlin/dsm/pick2024/domain/application/service/QueryMyApplicationService.kt
- src/main/kotlin/dsm/pick2024/domain/user/domain/User.kt
- src/main/kotlin/dsm/pick2024/domain/user/presentation/dto/response/QueryUserSimpleInfoResponse.kt
π§° Additional context used
π Additional comments (7)
src/main/kotlin/dsm/pick2024/domain/application/presentation/dto/response/QueryMyApplicationResponse.kt (1)
13-13
: νλ‘ν μμ± μΆκ°μ λν κ²νμλ‘μ΄
profile: String?
μμ±μ΄QueryMyApplicationResponse
λ°μ΄ν° ν΄λμ€μ μΆκ°λμμ΅λλ€. μ΄λ PRμ λͺ©μ μΈ μ¬μ©μ νλ‘ν μ΄λ―Έμ§ μ λ‘λ κΈ°λ₯ ꡬνκ³Ό μΌμΉν©λλ€.κ³ λ €μ¬ν:
- μμ±μ΄ nullable(
String?
)λ‘ μ μλ κ²μ μ μ ν΄ λ³΄μ λλ€. λͺ¨λ μ¬μ©μκ° νλ‘ν μ΄λ―Έμ§λ₯Ό κ°μ§κ³ μμ§ μμ μ μκΈ° λλ¬Έμ λλ€.- μ΄ λ³κ²½μΌλ‘ μΈν΄ κΈ°μ‘΄ μ½λμμ
QueryMyApplicationResponse
λ₯Ό μ¬μ©νλ λΆλΆμ μν₯μ΄ μμ μ μμ΅λλ€. κ΄λ ¨ μλΉμ€ λ° μ»¨νΈλ‘€λ¬ μ½λλ₯Ό κ²ν νμ¬ νμν κ²½μ° μ λ°μ΄νΈν΄μΌ ν©λλ€.λ€μ μ€ν¬λ¦½νΈλ₯Ό μ€ννμ¬
QueryMyApplicationResponse
λ₯Ό μ¬μ©νλ λ€λ₯Έ νμΌλ€μ νμΈν΄μ£ΌμΈμ:src/main/kotlin/dsm/pick2024/domain/user/presentation/UserController.kt (2)
7-7
: LGTM: μλ‘μ΄ import λ¬Έμ΄ μ¬λ°λ₯΄κ² μΆκ°λμμ΅λλ€.
UploadUserProfileUseCase
λ₯Ό μν import λ¬Έμ΄ μ μ ν μΆκ°λμμ΅λλ€. μ΄λ μλ‘μ΄ νλ‘ν μ λ‘λ κΈ°λ₯μ μν΄ νμν λ³κ²½μ¬νμ λλ€.
32-33
: LGTM: μμ±μμ μλ‘μ΄ μμ‘΄μ±μ΄ μ¬λ°λ₯΄κ² μΆκ°λμμ΅λλ€.
UploadUserProfileUseCase
κ°UserController
μ μμ±μμ μ μ ν μΆκ°λμμ΅λλ€. μ΄λ κΈ°μ‘΄μ μμ‘΄μ± μ£Όμ ν¨ν΄μ λ°λ₯΄κ³ μμΌλ©°, μλ‘μ΄ νλ‘ν μ λ‘λ κΈ°λ₯μ μν΄ νμν λ³κ²½μ¬νμ λλ€.src/main/kotlin/dsm/pick2024/domain/user/service/QueryUserSimpleInfoService.kt (3)
6-7
: FileUtil λ° PathList import μΆκ°κ° μ μ ν©λλ€'FileUtil'κ³Ό 'PathList'λ₯Ό importνμ¬ νμΌ κ΄λ ¨ κΈ°λ₯μ μ¬μ©ν μ μκ² λ μ μ΄ μ’μ΅λλ€.
13-14
: μμ±μμ FileUtil μμ‘΄μ± μ£Όμ'fileUtil'μ μμ±μμ μΆκ°νμ¬ μμ‘΄μ±μ μ£Όμ ν λ°©μμ΄ μ μ ν©λλ€. μ΄λ₯Ό ν΅ν΄ νμΌ μ νΈλ¦¬ν° κΈ°λ₯μ μλΉμ€μμ νμ©ν μ μμ΅λλ€.
20-26
: μ¬μ©μ νλ‘ν μ΄λ―Έμ§ URL μμ± λ‘μ§ μΆκ°'QueryUserSimpleInfoResponse' μμ± μ 'user.profile'μ΄ μ‘΄μ¬ν κ²½μ°μλ§ 'fileUtil.generateObjectUrl'μ μ¬μ©νμ¬ νλ‘ν μ΄λ―Έμ§ URLμ μμ±νλ λ‘μ§μ΄ μ μ νκ² κ΅¬νλμμ΅λλ€. 'user.profile'μ΄ nullμΌ μ μμΌλ―λ‘ μμ νΈμΆκ³Ό 'let' ν¨μλ₯Ό μ¬μ©νμ¬ null μμ μ±μ ν보ν μ μ΄ μ’μ΅λλ€.
src/main/kotlin/dsm/pick2024/domain/user/service/UploadUserProfileService.kt (1)
23-23
: π οΈ Refactor suggestion
if
λ¬Έμlet
μΌλ‘ λ³κ²½νμ¬ μ½λ κ°κ²°νκΈ°μ‘΄μ
if
λ¬Έμ Kotlinμlet
ν¨μλ₯Ό μ¬μ©νμ¬ λ κ°κ²°νκ³ μ½κΈ° μ½κ² μμ ν μ μμ΅λλ€.
close #252
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores