Skip to content

Commit

Permalink
✨ [Feature] 개인일정 수정 API Controller 수정 메서드 추가 #1057
Browse files Browse the repository at this point in the history
  • Loading branch information
taehyeon committed Dec 30, 2024
1 parent d754767 commit 9351a15
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,4 +32,14 @@ public ResponseEntity<Void> privateScheduleCreate(@Login @Parameter(hidden = tru
privateScheduleService.createPrivateSchedule(userDto, privateScheduleCreateReqDto);
return ResponseEntity.status(HttpStatus.CREATED).build();
}

@PutMapping("/{id}")
public ResponseEntity<PrivateScheduleUpdateResDto> 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);
}
}

0 comments on commit 9351a15

Please sign in to comment.