diff --git a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/GatheringController.java b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/GatheringController.java index f992165..af28801 100644 --- a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/GatheringController.java +++ b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/GatheringController.java @@ -20,7 +20,7 @@ public class GatheringController implements GatheringApiDocs { private final GatheringService gatheringService; - @GetMapping() + @GetMapping public GatheringListResponseDto findGatheringList(Principal principal, @RequestParam("si") String si, @RequestParam("dong") String dong, @@ -28,14 +28,14 @@ public GatheringListResponseDto findGatheringList(Principal principal, return gatheringService.getGatheringByPlace(si, dong, gu); } - @PostMapping() + @PostMapping public GatheringResponseDto createGathering(Principal principal, @RequestBody GatheringDto gatheringDto) { Long userId = getUserId(principal); return gatheringService.createGathering(userId, gatheringDto); } - @PutMapping({"{gatheringId}"}) + @PutMapping("{gatheringId}") public GatheringResponseDto modifyGatheringByHost(Principal principal, @PathVariable("gatheringId") Long gatheringId, @RequestBody GatheringDto gatheringDto) { @@ -43,18 +43,20 @@ public GatheringResponseDto modifyGatheringByHost(Principal principal, return gatheringService.modifyGatheringInfoByHost(userId, gatheringId, gatheringDto); } - @PostMapping("success") + @PostMapping("{gatheringId}/success") public GatheringClosedResponse successGatheringByHost(Principal principal, + @PathVariable("gatheringId") Long gatheringId, GatheringSuccessDto successDto) { Long userId = getUserId(principal); - return gatheringService.successGatheringByHost(userId, successDto); + return gatheringService.successGatheringByHost(userId, gatheringId, successDto); } - @PostMapping("cancel") + @PostMapping("{gatheringId}/cancel") public GatheringClosedResponse cancelGatheringByHost(Principal principal, + @PathVariable("gatheringId") Long gatheringId, GatheringCancelDto cancelDto) { Long userId = getUserId(principal); - return gatheringService.cancelGatheringByHost(userId, cancelDto); + return gatheringService.cancelGatheringByHost(userId, gatheringId, cancelDto); } private Long getUserId(Principal principal) { diff --git a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/docs/GatheringApiDocs.java b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/docs/GatheringApiDocs.java index 4a1a722..313d389 100644 --- a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/docs/GatheringApiDocs.java +++ b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/docs/GatheringApiDocs.java @@ -68,7 +68,9 @@ GatheringResponseDto modifyGatheringByHost(Principal principal, description = "유효하지 않은 코드가 전달되었을 때" ) }) - GatheringClosedResponse cancelGatheringByHost(Principal principal, GatheringCancelDto cancelDto); + GatheringClosedResponse cancelGatheringByHost(Principal principal, + Long gatheringId, + GatheringCancelDto cancelDto); @Operation(summary = "모임 성공적 종료") @ApiResponses(value = { @@ -81,5 +83,7 @@ GatheringResponseDto modifyGatheringByHost(Principal principal, description = "유효하지 않은 코드가 전달되었을 때" ) }) - GatheringClosedResponse successGatheringByHost(Principal principal, GatheringSuccessDto successDto); + GatheringClosedResponse successGatheringByHost(Principal principal, + Long gatheringId, + GatheringSuccessDto successDto); } diff --git a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringCancelDto.java b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringCancelDto.java index 68f4ff7..c7263cd 100644 --- a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringCancelDto.java +++ b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringCancelDto.java @@ -3,7 +3,6 @@ import dev.office.networkoffice.gathering.domain.ReasonForCanceled; public record GatheringCancelDto( - Long gatheringId, ReasonForCanceled reason ) { } diff --git a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringSuccessDto.java b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringSuccessDto.java index a9d70ff..a2cb8ea 100644 --- a/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringSuccessDto.java +++ b/Network-Office/src/main/java/dev/office/networkoffice/gathering/controller/dto/request/GatheringSuccessDto.java @@ -1,7 +1,7 @@ package dev.office.networkoffice.gathering.controller.dto.request; public record GatheringSuccessDto( - Long gatheringId, String review, - Integer star) { + Integer star +) { } diff --git a/Network-Office/src/main/java/dev/office/networkoffice/gathering/service/GatheringService.java b/Network-Office/src/main/java/dev/office/networkoffice/gathering/service/GatheringService.java index fd84d67..5568650 100644 --- a/Network-Office/src/main/java/dev/office/networkoffice/gathering/service/GatheringService.java +++ b/Network-Office/src/main/java/dev/office/networkoffice/gathering/service/GatheringService.java @@ -75,8 +75,8 @@ public GatheringResponseDto modifyGatheringInfoByHost(Long hostId, Long gatherin } @Transactional - public GatheringClosedResponse successGatheringByHost(Long hostId, GatheringSuccessDto successDto) { - Gathering gathering = verifyHostAndFindGathering(hostId, successDto.gatheringId()); + public GatheringClosedResponse successGatheringByHost(Long hostId, Long gatheringId, GatheringSuccessDto successDto) { + Gathering gathering = verifyHostAndFindGathering(hostId, gatheringId); gathering.changeStatusToSuccessFul(successDto.review(), successDto.star()); return GatheringClosedResponse.from(gathering.getGatheringStatus().name()); @@ -86,8 +86,8 @@ public GatheringClosedResponse successGatheringByHost(Long hostId, GatheringSucc * 모임 파토. 호스트만 지울 수 있고, 지우기 전에 사유를 기록해야됨. */ @Transactional - public GatheringClosedResponse cancelGatheringByHost(Long hostId, GatheringCancelDto cancelDto) { - Gathering gathering = verifyHostAndFindGathering(hostId, cancelDto.gatheringId()); + public GatheringClosedResponse cancelGatheringByHost(Long hostId, Long gatheringId, GatheringCancelDto cancelDto) { + Gathering gathering = verifyHostAndFindGathering(hostId, gatheringId); gathering.changeStatusToCancel(cancelDto.reason()); return GatheringClosedResponse.from(gathering.getGatheringStatus().name());