From b42e367faca7a611a64a5df119941ab535d13779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:04:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix=20:=20=EA=B8=80=EC=9E=90=EC=88=98=20?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EA=B3=BC=EC=97=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../missionArchive/application/dto/req/MissionArchiveReq.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/moing/backend/domain/missionArchive/application/dto/req/MissionArchiveReq.java b/src/main/java/com/moing/backend/domain/missionArchive/application/dto/req/MissionArchiveReq.java index e0c82411..6bc71af4 100644 --- a/src/main/java/com/moing/backend/domain/missionArchive/application/dto/req/MissionArchiveReq.java +++ b/src/main/java/com/moing/backend/domain/missionArchive/application/dto/req/MissionArchiveReq.java @@ -2,12 +2,15 @@ import lombok.*; +import javax.validation.constraints.Size; + @Builder @NoArgsConstructor @Getter public class MissionArchiveReq { private String status; + @Size(min = 1, max = 4000) private String archive; //사진일 경우 파일명, 이외에는 text,link @Builder From ea5f269188db4401d0030230e85e65ea193bea46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=20=EC=8A=B9=20=EC=97=B0?= <53565255+seungyeonnnnnni@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:07:07 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix=20:=20MissionArchiveController=20@Valid?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MissionArchiveController.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/moing/backend/domain/missionArchive/presentation/MissionArchiveController.java b/src/main/java/com/moing/backend/domain/missionArchive/presentation/MissionArchiveController.java index 77169a15..04c6ba67 100644 --- a/src/main/java/com/moing/backend/domain/missionArchive/presentation/MissionArchiveController.java +++ b/src/main/java/com/moing/backend/domain/missionArchive/presentation/MissionArchiveController.java @@ -1,5 +1,6 @@ package com.moing.backend.domain.missionArchive.presentation; +import com.moing.backend.domain.member.domain.entity.Member; import com.moing.backend.domain.mission.application.dto.res.GatherRepeatMissionRes; import com.moing.backend.domain.missionArchive.application.dto.req.MissionArchiveReq; import com.moing.backend.domain.missionArchive.application.dto.res.MissionArchiveRes; @@ -8,6 +9,7 @@ import com.moing.backend.domain.missionArchive.application.dto.res.PersonalArchiveRes; import com.moing.backend.domain.missionArchive.application.service.*; import com.moing.backend.domain.missionArchive.domain.service.MissionArchiveDeleteService; +import com.moing.backend.domain.missionArchive.domain.service.MissionArchiveScheduleQueryService; import com.moing.backend.domain.missionHeart.application.dto.MissionHeartRes; import com.moing.backend.domain.missionHeart.application.service.MissionHeartUseCase; import com.moing.backend.global.config.security.dto.User; @@ -17,6 +19,7 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; import static com.moing.backend.domain.missionArchive.domain.constant.MissionArchiveResponseMessage.*; @@ -46,8 +49,8 @@ public class MissionArchiveController { public ResponseEntity> createArchive(@AuthenticationPrincipal User user, @PathVariable("teamId") Long teamId, @PathVariable("missionId") Long missionId, - @RequestBody MissionArchiveReq missionArchiveReq) { - return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveCreateUseCase.createArchive(user.getSocialId(), missionId,missionArchiveReq))); + @Valid @RequestBody MissionArchiveReq missionArchiveReq) { + return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveCreateUseCase.createArchive(user.getSocialId(), missionId, missionArchiveReq))); } /** @@ -61,8 +64,9 @@ public ResponseEntity> updateArchive(@Authent @PathVariable("teamId") Long teamId, @PathVariable("missionId") Long missionId, @RequestBody MissionArchiveReq missionArchiveReq) { - return ResponseEntity.ok(SuccessResponse.create(UPDATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveUpdateUseCase.updateArchive(user.getSocialId(), missionId,missionArchiveReq))); + return ResponseEntity.ok(SuccessResponse.create(UPDATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveUpdateUseCase.updateArchive(user.getSocialId(), missionId, missionArchiveReq))); } + /** * 미션 인증 취소하기 * [DELETE] {teamId}/missions/{missionId}/archive @@ -71,8 +75,8 @@ public ResponseEntity> updateArchive(@Authent @DeleteMapping() public ResponseEntity> deleteArchive(@AuthenticationPrincipal User user, - @PathVariable("teamId") Long teamId, - @PathVariable("missionId") Long missionId) { + @PathVariable("teamId") Long teamId, + @PathVariable("missionId") Long missionId) { return ResponseEntity.ok(SuccessResponse.create(UPDATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveDeleteUseCase.deleteArchive(user.getSocialId(), missionId))); } @@ -98,7 +102,7 @@ public ResponseEntity> getMyArchive(@Authen public ResponseEntity>> getOtherPeopleArchives(@AuthenticationPrincipal User user, @PathVariable("teamId") Long teamId, @PathVariable("missionId") Long missionId) { - return ResponseEntity.ok(SuccessResponse.create(READ_TEAM_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveReadUseCase.getPersonalArchive(user.getSocialId(),missionId))); + return ResponseEntity.ok(SuccessResponse.create(READ_TEAM_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveReadUseCase.getPersonalArchive(user.getSocialId(), missionId))); } @@ -114,7 +118,7 @@ public ResponseEntity> pushHeart(@Authenticatio @PathVariable("missionId") Long missionId, @PathVariable("archiveId") Long archiveId, @PathVariable("missionHeartStatus") String missionHeartStatus) { - return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionHeartUseCase.pushHeart(user.getSocialId(),archiveId,missionHeartStatus))); + return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionHeartUseCase.pushHeart(user.getSocialId(), archiveId, missionHeartStatus))); } /** @@ -131,7 +135,6 @@ public ResponseEntity> getMissionDoneSt } - /** * 반복미션 - 나의 성공 횟수 조회 * [GET] {teamId}/missions/{missionId}/archive/my-status @@ -140,14 +143,10 @@ public ResponseEntity> getMissionDoneSt @GetMapping("/my-status") public ResponseEntity> getMyMissionDoneStatus(@AuthenticationPrincipal User user, - @PathVariable("teamId") Long teamId, - @PathVariable("missionId") Long missionId) { - return ResponseEntity.ok(SuccessResponse.create(MISSION_ARCHIVE_PEOPLE_STATUS_SUCCESS.getMessage(), this.repeatMissionArchiveReadUseCase.getMyMissionDoneStatus(user.getSocialId(),missionId))); + @PathVariable("teamId") Long teamId, + @PathVariable("missionId") Long missionId) { + return ResponseEntity.ok(SuccessResponse.create(MISSION_ARCHIVE_PEOPLE_STATUS_SUCCESS.getMessage(), this.repeatMissionArchiveReadUseCase.getMyMissionDoneStatus(user.getSocialId(), missionId))); } - - - - } \ No newline at end of file