diff --git a/api/src/main/kotlin/com/mashup/dojo/PickController.kt b/api/src/main/kotlin/com/mashup/dojo/PickController.kt index 105a137a..575c575a 100644 --- a/api/src/main/kotlin/com/mashup/dojo/PickController.kt +++ b/api/src/main/kotlin/com/mashup/dojo/PickController.kt @@ -145,7 +145,6 @@ class PickController( questionContent = pickDetailPaging.questionContent, questionEmojiImageUrl = pickDetailPaging.questionEmojiImageUrl, totalReceivedPickCount = pickDetailPaging.totalReceivedPickCount, - anyOpenPickerCount = pickDetailPaging.anyOpenPickerCount, picks = pickDetails, totalPage = pickDetailPaging.totalPage, totalElements = pickDetailPaging.totalElements, diff --git a/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt b/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt index ffb5d5e9..4481067b 100644 --- a/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt +++ b/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt @@ -52,7 +52,6 @@ data class PickDetailPaging( val questionContent: String, val questionEmojiImageUrl: String, val totalReceivedPickCount: Int, - val anyOpenPickerCount: Int, val picks: List, val totalPage: Int, val totalElements: Long, diff --git a/entity/src/main/kotlin/com/mashup/dojo/PickRepository.kt b/entity/src/main/kotlin/com/mashup/dojo/PickRepository.kt index 66c933b8..9bcf41e3 100644 --- a/entity/src/main/kotlin/com/mashup/dojo/PickRepository.kt +++ b/entity/src/main/kotlin/com/mashup/dojo/PickRepository.kt @@ -57,11 +57,6 @@ interface PickRepositoryCustom { questionId: String, ): Long - fun getOpenPickerCount( - questionId: String, - memberId: String, - ): Long - fun findPickCountByMemberId(memberId: String): Long fun findSolvedPick( @@ -155,22 +150,6 @@ class PickRepositoryImpl( .fetchOne() ?: 0 } - override fun getOpenPickerCount( - questionId: String, - memberId: String, - ): Long { - val pickEntity = QPickEntity.pickEntity - return jpaQueryFactory - .select(Wildcard.count) - .from(pickEntity) - .where( - pickEntity.questionId.eq(questionId), - pickEntity.pickedId.eq(memberId), - isAnyOpen(pickEntity) - ) - .fetchOne() ?: 0 - } - private fun isAnyOpen(pickEntity: QPickEntity): BooleanExpression? { return pickEntity.isGenderOpen .or(pickEntity.isPlatformOpen) diff --git a/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt b/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt index 36333920..7fa70f47 100644 --- a/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt +++ b/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt @@ -68,11 +68,6 @@ interface PickService { fun getNextPickTime(): LocalDateTime - fun getAnyOpenPickerCount( - questionId: QuestionId, - memberId: MemberId, - ): Int - fun getReceivedMySpacePicks(memberId: MemberId): List data class GetPickPaging( @@ -390,13 +385,6 @@ class DefaultPickService( return nextPickTime ?: today.plusDays(1).atTime(pickTimes.first()) } - override fun getAnyOpenPickerCount( - questionId: QuestionId, - memberId: MemberId, - ): Int { - return pickRepository.getOpenPickerCount(questionId.value, memberId.value).toInt() - } - override fun getReceivedMySpacePicks(memberId: MemberId): List { return pickRepository.findTopRankPicksByMemberId(memberId = memberId.value, rank = defaultRankSize).map { pick -> val pickCount = pickRepository.findPickDetailCount(memberId = memberId.value, questionId = pick.questionId) diff --git a/service/src/main/kotlin/com/mashup/dojo/usecase/PickUseCase.kt b/service/src/main/kotlin/com/mashup/dojo/usecase/PickUseCase.kt index 09374c4c..c082bff5 100644 --- a/service/src/main/kotlin/com/mashup/dojo/usecase/PickUseCase.kt +++ b/service/src/main/kotlin/com/mashup/dojo/usecase/PickUseCase.kt @@ -41,7 +41,6 @@ interface PickUseCase { val questionContent: String, val questionEmojiImageUrl: String, val totalReceivedPickCount: Int, - val anyOpenPickerCount: Int, val picks: List, val totalPage: Int, val totalElements: Long, @@ -143,14 +142,11 @@ class DefaultPickUseCase( val receivedPickPaging = pickService.getPickDetailPaging(question.id, command.memberId, command.pageNumber, command.pageSize) - val anyOpenPickerCount = pickService.getAnyOpenPickerCount(question.id, command.memberId) - return PickUseCase.GetPickDetailPaging( questionId = question.id, questionContent = question.content, questionEmojiImageUrl = imageUrl, totalReceivedPickCount = pickCount, - anyOpenPickerCount = anyOpenPickerCount, picks = receivedPickPaging.picks, totalPage = receivedPickPaging.totalPage, totalElements = receivedPickPaging.totalElements,