Skip to content
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

[Feature/449] 이미지 3장 올리는 API 구현 #457

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

injoon2019
Copy link
Collaborator

@injoon2019 injoon2019 commented Sep 25, 2024

💡 이슈 번호

close: #449

✨ 작업 내용

  • 이미지 3장 올리는 API 구현
  • 이제 이미지 올리기 + 자기소개를 한 api에 묶게됩니다!

🚀 전달 사항

https://www.notion.so/teamnexters/4046d5d312044bd89a7a12259b461616?pvs=4

@@ -68,6 +68,15 @@ class UserProfileService(
fun uploadImageUrl(user: User, imageUrl: String, blurredImageUrl: String) {
profileRepository.findByUserId(user.id)?.let {
it.imageUrl = imageUrl
it.imageUrls = listOf(imageUrl)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이 pr이 배포나가게 되면 네이티브 배포 나가기 전에 image_urls 컬럼에도 채우게됩니다

Copy link
Member

Choose a reason for hiding this comment

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

그럼 기존 유저들은 일단 imageUrls는 빈 배열로 되어있는거죠?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

맞아요! 이것도 이 pr 배포나가서 신규 유저들이 이미지 올리면 imageUrls에 쌓이게 된다면, 기존 유저들은 쿼리로 ["기존 imageUrl"] 이렇게 넣어줄 예정이에요

@injoon2019 injoon2019 self-assigned this Sep 25, 2024
Copy link
Member

@miseongk miseongk left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!! 👍

val originalImageUrls = files.zip(paths)
.map { (file, path) -> fileService.upload(file, path) }
.map { it.toString() }
val blurredImageUrl = imageUploader.uploadWithBlur(files[0], paths[0]);
Copy link
Member

Choose a reason for hiding this comment

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

오 이미지 블러 처리는 첫번째 이미지만 해주는군요!

@@ -30,6 +30,9 @@ class UserProfile(

var imageUrl: String? = null,

@Convert(converter = QuestionAndAnswerConverter::class)
Copy link
Member

Choose a reason for hiding this comment

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

Converter가 잘못됐어요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오 감사합니다!!

@@ -68,6 +68,15 @@ class UserProfileService(
fun uploadImageUrl(user: User, imageUrl: String, blurredImageUrl: String) {
profileRepository.findByUserId(user.id)?.let {
it.imageUrl = imageUrl
it.imageUrls = listOf(imageUrl)
Copy link
Member

Choose a reason for hiding this comment

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

그럼 기존 유저들은 일단 imageUrls는 빈 배열로 되어있는거죠?

fun upsertIntroductionAndImages(
@AuthUserId userId: Long,
@RequestPart("files") files: List<MultipartFile>,
@RequestPart("introduction") registerIntroductionRequest: RegisterIntroductionRequest,
Copy link
Member

Choose a reason for hiding this comment

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

사진이랑 ResponseBody랑 같이 보내려면 body도 RequestPart로 보내야하는건가요?!

private val profileFacadeV2: UserProfileFacadeV2,
) {

@ApiOperation("마이페이지 자기소개 & 사진들 등록/수정하기")
Copy link
Member

Choose a reason for hiding this comment

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

아! 그리고 저희 수정할 때는 자기소개랑 사진들 각각 수정할 수 있어야 할 것 같은데,
"사진들 수정하기 api"는 따로 있어야 하지 않을까요?

스크린샷 2024-09-26 오후 2 44 07

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

요거 태환님이랑 얘기할때는 API 하나로 두고, 프론트에서 요청 보낼떄 사진 수정이더라도 자기소개까지 보내달라했어요!

Copy link
Member

Choose a reason for hiding this comment

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

태환님이 혹시 황태환님인가요? ㅋㅋ 알겠습니다 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

이미지 3장 등록 가능한 구조 만들기
3 participants