File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
src/main/kotlin/gogo/gogostage/domain/stage/root Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,12 @@ data class QueryMyStageInfoDto(
170170 val isMaintaining : Boolean
171171)
172172
173+ data class StageParticipantPointOnly (
174+ val id : Long ,
175+ val studentId : Long ,
176+ val point : Long
177+ )
178+
173179data class StageParticipantPointRankDto (
174180 val info : PageDto ,
175181 val rank : List <PointRankDto >
Original file line number Diff line number Diff line change 11package gogo.gogostage.domain.stage.root.persistence
22
33import com.querydsl.core.BooleanBuilder
4+ import com.querydsl.core.types.Projections
45import com.querydsl.jpa.impl.JPAQueryFactory
56import gogo.gogostage.domain.stage.participant.root.persistence.QStageParticipant.stageParticipant
67import gogo.gogostage.domain.stage.root.application.dto.PageDto
78import gogo.gogostage.domain.stage.root.application.dto.PointRankDto
9+ import gogo.gogostage.domain.stage.root.application.dto.StageParticipantPointOnly
810import gogo.gogostage.domain.stage.root.application.dto.StageParticipantPointRankDto
911import gogo.gogostage.global.internal.student.api.StudentApi
1012import org.springframework.data.domain.Pageable
@@ -21,7 +23,16 @@ class StageCustomRepositoryImpl(
2123
2224 predicate.and (stageParticipant.stage.id.eq(stage.id))
2325
24- val studentParticipants = queryFactory.selectFrom(stageParticipant)
26+ val studentParticipants = queryFactory
27+ .select(
28+ Projections .constructor (
29+ StageParticipantPointOnly ::class .java,
30+ stageParticipant.id,
31+ stageParticipant.studentId,
32+ stageParticipant.point
33+ )
34+ )
35+ .from(stageParticipant)
2536 .where(predicate)
2637 .orderBy(stageParticipant.point.desc())
2738 .offset(pageable.offset)
@@ -59,4 +70,4 @@ class StageCustomRepositoryImpl(
5970
6071 }
6172
62- }
73+ }
You can’t perform that action at this time.
0 commit comments