Skip to content

Conversation

@HI-JIN2
Copy link
Member

@HI-JIN2 HI-JIN2 commented May 28, 2025

Summary

사진 업로드 및 포토리뷰 작성 안됨 이슈를 해결하였습니다.

  1. 사진 -> 멀티파트 변환을 Acitivity에서 했었는데, 클린아키텍쳐를 깬다고 판단해서 presentation - > domain까지는 그냥 File 그 자체(생 파일은 아님 파일 크기 작게 압축한 파일임)로 넘기고 RepositoryImpl의 메소드에서 multipartBody로 변환합니다.
  2. login이랑 splash 코드 수정했던 것처럼 여기도 uistate와 uievnet로 리팩토링하였습니다. 마찬가지로 Loading (리뷰 업로드 중)에는 프로그레스바를 넣었습니다. 이거는 추후에 커스텀으로 하던, 공통 UI로 빼던 처리하면 좋을 것 같으요
  3. 기획단에서 리뷰 텍스트 3자 이상으로 안적어도 리뷰 작성 되게 (별점만 달면 리뷰 작성되도록) 수정하여서 반영하였습니다.

Describe your changes

zza.webm

Issue

To reviewers

  1. UploadReviewState안에 정의할게 없어서 비워두었습니다. 괜찮을까요?
  2. 전반적으로 클린한지? 봐주시면 감사하겠습니다.

@HI-JIN2 HI-JIN2 requested a review from Copilot May 28, 2025 09:01
@HI-JIN2 HI-JIN2 self-assigned this May 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This hotfix resolves issues with photo upload and review submission by refactoring the review view model logic, image upload use case, and associated UI behaviors. Key changes include updating the postReview API to accept parameters, refactoring image compression/upload handling to use File objects instead of multipart parameters, and cleaning up redundant view models and logging in network interceptors.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ReviewWriteViewModel.kt Updated postReview API, introduced saveS3 for file-based image upload, and adjusted UI state handling
ReviewWriteRateActivity.kt Refactored image selection, compression, and review submission workflow with improved permission handling
ImageViewModel.kt Removed redundant code as its functionality was migrated to UploadReviewViewModel
ReviewAdapter.kt Modified image display logic to safely handle nullable image URLs
GetImageUrlUseCase.kt Updated to accept a File rather than a MultipartBody.Part for image upload
ReviewRepository.kt Adjusted interface to support the file-based image upload method
TokenInterceptor.kt Cleaned up unnecessary imports and logging for token header management
ReviewRepositoryImpl.kt Updated repository implementation to build multipart requests from File objects
Comments suppressed due to low confidence (1)

app/src/main/java/com/eatssu/android/presentation/cafeteria/review/write/ReviewWriteViewModel.kt:39

  • The onCompletion block in postReview unconditionally sets the error flag to true, which might override a successful response. Consider either removing this update or conditionally setting the error flag only when an error truly occurs.
_uiState.update { it.copy(loading = false, error = true) }

@HI-JIN2 HI-JIN2 marked this pull request as ready for review May 28, 2025 09:32
@HI-JIN2 HI-JIN2 requested a review from kangyuri1114 May 28, 2025 09:35
Copy link
Member

@kangyuri1114 kangyuri1114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿! 배포해주세용

var error: Boolean = false,
var isUpload: Boolean = false,
)
sealed class UploadReviewState
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 쓰이는 곳 없으면 지우는 게 좋을 것 같습니당

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오옹 근데 그러면 UiState에 끼울게 없습니다...!

@HI-JIN2 HI-JIN2 added 🪲 bug Something isn't working 🔥 hotfix 이미 배포된 버전에서 장애가 있는 이슈에 답니다. labels May 28, 2025
@HI-JIN2 HI-JIN2 merged commit 76ed283 into develop May 28, 2025
1 check passed
@HI-JIN2 HI-JIN2 deleted the hotfix/not-working-photo-review branch May 28, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪲 bug Something isn't working 🔥 hotfix 이미 배포된 버전에서 장애가 있는 이슈에 답니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 사진 리뷰 에러

3 participants