[Koin Project][Refactor] Presigned Url 업로드 로직 리팩토링#1230
Merged
kongwoojin merged 4 commits intodevelopfrom Jan 21, 2026
Merged
Conversation
KYM-P
approved these changes
Jan 19, 2026
Collaborator
KYM-P
left a comment
There was a problem hiding this comment.
오 제 주옥같은 club 코드를 읽고 수정하시다니 👍
확실히 하나로 줄이는편이 좋은 것 같습니다.
또한 이제야 좀 'UseCase' 라는 느낌이 있네요
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 개요
PR 체크리스트
작업사항
작업사항의 상세한 설명
기존의 Presigned Url 업로드는 아래와 같은 과정을 통해 이루어졌습니다.
이 과정에서 두개의 usecase를 호출하였으며, presigned url을 viewmodel에서 받아서 다시 usecase 호출 시 parameter로 넘겨주는 방식으로 작동했습니다.
코드로 설명하자면, 이전에는 다음과 같은 코드로 Presigned url을 활용한 이미지 업로드를 처리했습니다.
requestPresignedUrl()함수에서 presigned url 을 획득한 후,uploadFile()함수에서 실제 업로드를 진행했습니다.이에 따라 불필요하게 에러 처리를 두번 수행해야 했으며, viewmodel에서 presigned url을 굳이 알 필요가 없음에도 알게 된다는 문제점이 있었습니다.
또한, presigned url을 usecase를 통해 획득하고 실제 업로드가 진행되지 않을 경우, 이미지가 업로드 되지 않고 빈 file url만 남을 수 있는 문제가 있었습니다.
따라서, 하나의 usecase를 호출하여 이미지를 처리할 수 있도록 수정했습니다.
수정된 usecase를 활용한 이미지 업로드는 다음과 같습니다.
새로운 usecase에서는 중복 에러 처리 문제를 수정하였으며, 하나의 usecase만으로 이미지 업로드를 처리할 수 있습니다.
또한, 기존에 도메인 별로 분리되어 있던 이미지 업로드 usecase를 하나로 통합하였으며, viewmodel에서 usecase 호출 시 어느 도메인인지 선언하도록 수정하였습니다.
추가로, 동아리와 상점 리뷰 화면에서 해당 usecase를 사용하도록 리팩토링 하였습니다.
논의 사항
스크린샷
추가내용