From 9351a15f1b084300d448141ebcc096968a140b47 Mon Sep 17 00:00:00 2001 From: taehyeon Date: Mon, 30 Dec 2024 16:27:37 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20[Feature]=20=EA=B0=9C=EC=9D=B8?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EC=88=98=EC=A0=95=20API=20Controller=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20#1057?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PrivateScheduleController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gg-calendar-api/src/main/java/gg/calendar/api/user/schedule/privateschedule/controller/PrivateScheduleController.java b/gg-calendar-api/src/main/java/gg/calendar/api/user/schedule/privateschedule/controller/PrivateScheduleController.java index 4da3bd1a8..99db490f2 100644 --- a/gg-calendar-api/src/main/java/gg/calendar/api/user/schedule/privateschedule/controller/PrivateScheduleController.java +++ b/gg-calendar-api/src/main/java/gg/calendar/api/user/schedule/privateschedule/controller/PrivateScheduleController.java @@ -5,13 +5,17 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import gg.auth.UserDto; import gg.auth.argumentresolver.Login; import gg.calendar.api.user.schedule.privateschedule.controller.request.PrivateScheduleCreateReqDto; +import gg.calendar.api.user.schedule.privateschedule.controller.request.PrivateScheduleUpdateReqDto; +import gg.calendar.api.user.schedule.privateschedule.controller.response.PrivateScheduleUpdateResDto; import gg.calendar.api.user.schedule.privateschedule.service.PrivateScheduleService; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; @@ -28,4 +32,14 @@ public ResponseEntity privateScheduleCreate(@Login @Parameter(hidden = tru privateScheduleService.createPrivateSchedule(userDto, privateScheduleCreateReqDto); return ResponseEntity.status(HttpStatus.CREATED).build(); } + + @PutMapping("/{id}") + public ResponseEntity privateScheduleUpdate( + @Login @Parameter(hidden = true) UserDto userDto, + @Valid @RequestBody PrivateScheduleUpdateReqDto privateScheduleUpdateReqDto, + @RequestParam Long id) { + PrivateScheduleUpdateResDto privateScheduleUpdateResDto = privateScheduleService.updatePrivateSchedule(userDto, + privateScheduleUpdateReqDto, id); + return ResponseEntity.status(HttpStatus.OK).body(privateScheduleUpdateResDto); + } }