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); + } }