From 710c0e75883ccb025d79500ba3e01a315c9f02b4 Mon Sep 17 00:00:00 2001 From: 210-reverof Date: Mon, 19 Aug 2024 23:25:09 +0900 Subject: [PATCH 1/2] fix: Fix index error (add param) --- .../pic/vote/applicationservice/VoteApplicationService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pic-api/src/main/kotlin/com/mashup/pic/vote/applicationservice/VoteApplicationService.kt b/pic-api/src/main/kotlin/com/mashup/pic/vote/applicationservice/VoteApplicationService.kt index 8d54731..31459d5 100644 --- a/pic-api/src/main/kotlin/com/mashup/pic/vote/applicationservice/VoteApplicationService.kt +++ b/pic-api/src/main/kotlin/com/mashup/pic/vote/applicationservice/VoteApplicationService.kt @@ -34,8 +34,8 @@ class VoteApplicationService( voteService.markVoted(request.userId, request.eventId) if (voteService.hasEveryoneVoted(request.eventId)) { + resultService.generateResult(request.eventId) eventService.endEventVoting(request.eventId) - resultService.generateResult(10) } val randomImageUrl = voteService.getVotedRandomImageUrl(request.userId, request.eventId) From bc85d9bcfd0fd2bdbb061fbc93c56fa639959502 Mon Sep 17 00:00:00 2001 From: 210-reverof Date: Mon, 19 Aug 2024 23:28:01 +0900 Subject: [PATCH 2/2] chore: Add validation --- .../mashup/pic/event/controller/dto/UploadImageRequest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pic-api/src/main/kotlin/com/mashup/pic/event/controller/dto/UploadImageRequest.kt b/pic-api/src/main/kotlin/com/mashup/pic/event/controller/dto/UploadImageRequest.kt index cb06b4f..cea2ec8 100644 --- a/pic-api/src/main/kotlin/com/mashup/pic/event/controller/dto/UploadImageRequest.kt +++ b/pic-api/src/main/kotlin/com/mashup/pic/event/controller/dto/UploadImageRequest.kt @@ -1,10 +1,12 @@ package com.mashup.pic.event.controller.dto import com.mashup.pic.event.applicationService.dto.UploadImageServiceRequest +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Size data class UploadImageRequest( - val eventId: Long, - val imageUrls: List + @field:NotNull val eventId: Long, + @field:Size(min = 1) val imageUrls: List ) fun UploadImageRequest.toServiceRequest(userId: Long): UploadImageServiceRequest = UploadImageServiceRequest(userId, eventId, imageUrls)