Skip to content

Commit f9f49e4

Browse files
committed
fix: 모임 사용자만 모임 접근 가능
1 parent 3d63dba commit f9f49e4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tuk-api/src/main/kotlin/nexters/tuk/application/proposal/ProposalQueryService.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package nexters.tuk.application.proposal
22

3+
import nexters.tuk.application.gathering.GatheringMemberService
34
import nexters.tuk.application.gathering.vo.RelativeTime
45
import nexters.tuk.application.proposal.dto.request.ProposalQuery
56
import nexters.tuk.application.proposal.dto.response.ProposalResponse
@@ -19,6 +20,7 @@ enum class ProposalDirection {
1920
@Service
2021
class ProposalQueryService(
2122
private val proposalQueryRepository: ProposalQueryRepository,
23+
private val gatheringMemberService: GatheringMemberService,
2224
) {
2325
@Transactional(readOnly = true)
2426
fun getMemberProposals(query: ProposalQuery.MemberProposals): SliceResponse<ProposalResponse.ProposalOverview> {
@@ -27,7 +29,7 @@ class ProposalQueryService(
2729
pageNumber = query.page.pageNumber - 1,
2830
pageSize = query.page.pageSize
2931
)
30-
32+
3133
val memberProposals = proposalQueryRepository.findMemberProposals(
3234
memberId = query.memberId,
3335
page = repositoryPage
@@ -47,12 +49,16 @@ class ProposalQueryService(
4749

4850
@Transactional(readOnly = true)
4951
fun getGatheringProposals(query: ProposalQuery.GatheringProposals): SliceResponse<ProposalResponse.ProposalOverview> {
50-
// 1-based pageNumber를 0-based로 변환
52+
gatheringMemberService.verifyGatheringAccess(
53+
gatheringId = query.gatheringId,
54+
memberId = query.memberId
55+
)
56+
5157
val repositoryPage = SliceRequest(
5258
pageNumber = query.page.pageNumber - 1,
5359
pageSize = query.page.pageSize
5460
)
55-
61+
5662
val gatheringProposals = proposalQueryRepository.findGatheringProposals(
5763
query.memberId,
5864
query.gatheringId,

0 commit comments

Comments
 (0)