feat: 메인 홈
- API 추가
This commit is contained in:
@@ -12,6 +12,7 @@ interface AuditionQueryRepository {
|
||||
fun getCompletedAuditionCount(isAdult: Boolean): Int
|
||||
fun getAuditionList(offset: Long, limit: Long, isAdult: Boolean): List<GetAuditionListItem>
|
||||
fun getAuditionDetail(auditionId: Long): GetAuditionDetailRawData
|
||||
fun getInProgressAuditionList(isAdult: Boolean): List<GetAuditionListItem>
|
||||
}
|
||||
|
||||
class AuditionQueryRepositoryImpl(
|
||||
@@ -94,4 +95,27 @@ class AuditionQueryRepositoryImpl(
|
||||
.where(audition.id.eq(auditionId))
|
||||
.fetchFirst()
|
||||
}
|
||||
|
||||
override fun getInProgressAuditionList(isAdult: Boolean): List<GetAuditionListItem> {
|
||||
var where = audition.isActive.isTrue
|
||||
.and(audition.status.eq(AuditionStatus.IN_PROGRESS))
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(audition.isAdult.isFalse)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
QGetAuditionListItem(
|
||||
audition.id,
|
||||
audition.title,
|
||||
audition.imagePath.prepend("/").prepend(cloudFrontHost),
|
||||
audition.status.eq(AuditionStatus.COMPLETED)
|
||||
)
|
||||
)
|
||||
.from(audition)
|
||||
.where(where)
|
||||
.orderBy(audition.status.desc())
|
||||
.fetch()
|
||||
}
|
||||
}
|
||||
|
@@ -28,4 +28,8 @@ class AuditionService(
|
||||
roleList = roleList
|
||||
)
|
||||
}
|
||||
|
||||
fun getInProgressAuditionList(isAdult: Boolean): List<GetAuditionListItem> {
|
||||
return repository.getInProgressAuditionList(isAdult)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user