Skip to content

Commit

Permalink
feat: 프로필 사진 여러장 조회 API 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
miseongk committed Oct 26, 2024
1 parent 4b66d76 commit 79af8dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.nexters.bottles.api.user.facade.dto.ExistIntroductionResponse
import com.nexters.bottles.api.user.facade.dto.ProfileChoiceResponse
import com.nexters.bottles.api.user.facade.dto.RegisterIntroductionRequest
import com.nexters.bottles.api.user.facade.dto.RegisterProfileRequest
import com.nexters.bottles.api.user.facade.dto.UserImagesResponse
import com.nexters.bottles.api.user.facade.dto.UserInfoResponse
import com.nexters.bottles.api.user.facade.dto.UserProfileResponse
import com.nexters.bottles.api.user.facade.dto.UserProfileStatusResponse
Expand Down Expand Up @@ -63,6 +64,13 @@ class UserProfileController(
profileFacade.uploadImage(userId, file)
}

@ApiOperation("마이페이지 사진 조회하기")
@GetMapping("/images")
@AuthRequired
fun getImages(@AuthUserId userId: Long): UserImagesResponse {
return profileFacade.getImages(userId)
}

@ApiOperation("자기소개 작성 여부 조회하기")
@GetMapping("/introduction/exist")
@AuthRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.nexters.bottles.api.user.facade.dto.ExistIntroductionResponse
import com.nexters.bottles.api.user.facade.dto.ProfileChoiceResponse
import com.nexters.bottles.api.user.facade.dto.RegisterIntroductionRequest
import com.nexters.bottles.api.user.facade.dto.RegisterProfileRequest
import com.nexters.bottles.api.user.facade.dto.UserImagesResponse
import com.nexters.bottles.api.user.facade.dto.UserInfoResponse
import com.nexters.bottles.api.user.facade.dto.UserProfileResponse
import com.nexters.bottles.api.user.facade.dto.UserProfileStatus
Expand Down Expand Up @@ -143,6 +144,11 @@ class UserProfileFacade(
) = "" + userId + FILE_NAME_DELIMITER + LocalDateTime.now()
.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + FILE_NAME_DELIMITER + file.originalFilename

fun getImages(userId: Long): UserImagesResponse {
val userProfile = profileService.findUserProfile(userId) ?: throw IllegalArgumentException("고객센터에 문의해주세요")
return UserImagesResponse(userImages = userProfile.imageUrls)
}

fun existIntroduction(userId: Long): ExistIntroductionResponse {
val userProfile = profileService.findUserProfile(userId)
return ExistIntroductionResponse(isExist = userProfile?.introduction?.isNotEmpty() ?: false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.nexters.bottles.api.user.facade.dto

data class UserImagesResponse(
val userImages: List<String> = emptyList()
) {
}

0 comments on commit 79af8dd

Please sign in to comment.