Skip to content

Commit

Permalink
feat: 차단한 유저수 알려주기
Browse files Browse the repository at this point in the history
  • Loading branch information
injoon2019 committed Sep 22, 2024
1 parent 5e7f93b commit 16bbe10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.nexters.bottles.app.common.component.ImageUploader
import com.nexters.bottles.app.user.domain.User
import com.nexters.bottles.app.user.domain.UserProfile
import com.nexters.bottles.app.user.domain.UserProfileSelect
import com.nexters.bottles.app.user.service.BlockContactListService
import com.nexters.bottles.app.user.service.UserProfileService
import com.nexters.bottles.app.user.service.UserService
import com.nexters.bottles.app.user.service.dto.SignInUpStep
Expand All @@ -32,6 +33,7 @@ class UserProfileFacade(
private val userService: UserService,
private val fileService: FileService,
private val imageUploader: ImageUploader,
private val blockContactListService: BlockContactListService,
) {

private val log = KotlinLogging.logger { }
Expand Down Expand Up @@ -77,14 +79,16 @@ class UserProfileFacade(
fun getMyProfile(userId: Long): UserProfileResponse {
val userProfile = profileService.findUserProfile(userId)
val user = userProfile?.user ?: userService.findByIdAndNotDeleted(userId)
val blockContactList = blockContactListService.findAllByUserId(user.id)
return UserProfileResponse(
userName = user.name,
age = user.getKoreanAge(),
kakaoId = user.kakaoId,
imageUrl = userProfile?.imageUrl,
introduction = userProfile?.introduction ?: emptyList(),
profileSelect = userProfile?.profileSelect,
isMatchActivated = user.isMatchActivated
isMatchActivated = user.isMatchActivated,
blockedUserCount = blockContactList.size
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class UserProfileResponse(
val imageUrl: String? = null,
val introduction: List<QuestionAndAnswer>,
val profileSelect: UserProfileSelect? = null,
val isMatchActivated: Boolean? = true
val isMatchActivated: Boolean? = true,
val blockedUserCount: Int = 0,
) {
}

0 comments on commit 16bbe10

Please sign in to comment.