fix(audition): 성인 여부 조회 기준을 인증 저장소로 변경한다
This commit is contained in:
@@ -22,7 +22,7 @@ class AuditionController(private val service: AuditionService) {
|
||||
service.getAuditionList(
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong(),
|
||||
isAdult = member?.auth != null
|
||||
memberId = member?.id
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package kr.co.vividnext.sodalive.audition
|
||||
|
||||
import kr.co.vividnext.sodalive.audition.role.AuditionRoleRepository
|
||||
import kr.co.vividnext.sodalive.member.auth.AuthRepository
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class AuditionService(
|
||||
private val repository: AuditionRepository,
|
||||
private val roleRepository: AuditionRoleRepository
|
||||
private val roleRepository: AuditionRoleRepository,
|
||||
private val authRepository: AuthRepository
|
||||
) {
|
||||
fun getAuditionList(offset: Long, limit: Long, isAdult: Boolean): GetAuditionListResponse {
|
||||
val inProgressCount = repository.getInProgressAuditionCount(isAdult = isAdult)
|
||||
@@ -16,6 +18,11 @@ class AuditionService(
|
||||
return GetAuditionListResponse(inProgressCount, completedCount, items)
|
||||
}
|
||||
|
||||
fun getAuditionList(offset: Long, limit: Long, memberId: Long?): GetAuditionListResponse {
|
||||
val isAdult = memberId?.let { authRepository.getAuthIdByMemberId(it) != null } ?: false
|
||||
return getAuditionList(offset = offset, limit = limit, isAdult = isAdult)
|
||||
}
|
||||
|
||||
fun getAuditionDetail(auditionId: Long): GetAuditionDetailResponse {
|
||||
val auditionDetail = repository.getAuditionDetail(auditionId = auditionId)
|
||||
val roleList = roleRepository.getAuditionRoleListByAuditionId(auditionId = auditionId)
|
||||
|
||||
Reference in New Issue
Block a user