@@ -255,6 +255,85 @@ public ResponseEntity<?> deleteCalendarPost(@PathVariable Long id) {
255255 return new ResponseEntity <>(HttpStatus .OK );
256256 }
257257
258+ @ Operation (summary = "캘린더 플랜 조회 API" ,
259+ description = "캘린더 일정 내의 캘린더 플랜을 조회합니다. 해당 캘린더 일정을 찾지 못하면 404 에러를 반환합니다" )
260+ @ ApiResponses (value = {
261+ @ ApiResponse (responseCode = "200" , description = "플랜 조회 성공" ,
262+ content = @ Content (schema = @ Schema (implementation = CalendarPlanContentsInfoList .class ))),
263+ @ ApiResponse (responseCode = "404" , description = "플랜 아이디가 잘못됨" ,
264+ content = @ Content (schema = @ Schema (implementation = ErrorResult .class ))
265+ )
266+ })
267+ @ Parameter (description = "조회할 캘린더 일정의 id" , required = true , name = "id" )
268+ @ GetMapping ("/plan/{id}" )
269+ public ResponseEntity <?> getPlan (@ PathVariable Long id ){
270+
271+ CalendarPlanContentsInfoList result = calendarService .getCalendarPlan (id );
272+
273+ return new ResponseEntity <>(result , HttpStatus .OK );
274+ }
275+
276+ @ Operation (summary = "캘린더 플랜 생성 API" ,
277+ description = "캘린더 플랜을 생성합니다. 캘린더 일정의 ID가 올바르지 않으면 404 에러를 반환합니다" )
278+ @ ApiResponses (value = {
279+ @ ApiResponse (responseCode = "200" , description = "플랜 생성 성공" ,
280+ content = @ Content (schema = @ Schema (implementation = CreateRes .class ))),
281+ @ ApiResponse (responseCode = "404" , description = "게시글 일정 ID가 잘못됨" ,
282+ content = @ Content (schema = @ Schema (implementation = ErrorResult .class ))
283+ )
284+ })
285+ @ PostMapping ("/plan/create" )
286+ public ResponseEntity <?> createPlan (@ RequestBody createCalendarPlanReq req ){
287+
288+ CalendarPlan calendarPlan = calendarService .createCalendarPlan (new CreateCalendarPlanDTO (
289+ req .body (),
290+ req .calendarScheduleId (),
291+ req .localDate ()
292+ ));
293+
294+ return new ResponseEntity <>(new CreateRes (calendarPlan .getId ()), HttpStatus .OK );
295+ }
296+
297+ @ Operation (summary = "캘린더 플랜 업데이트 API" ,
298+ description = "캘린더 플랜을 수정합니다. 해당 플랜을 찾지 못하면 404 코드를 반환합니다" )
299+ @ ApiResponses (value = {
300+ @ ApiResponse (responseCode = "200" , description = "플랜 수정 성공"
301+ ),
302+ @ ApiResponse (responseCode = "404" , description = "플랜 아이디가 잘못됨" ,
303+ content = @ Content (schema = @ Schema (implementation = ErrorResult .class ))
304+ )
305+ })
306+ @ Parameter (name = "id" , description = "캘린더 플랜의 id" , required = true )
307+ @ PostMapping ("/plan/{id}/update" )
308+ public ResponseEntity <?> updatePlan (@ PathVariable Long id , @ RequestBody UpdateCalendarPlanReq req ){
309+
310+ calendarService .updateCalendarPlan (new UpdateCalendarPlanDTO (
311+ id ,
312+ req .body (),
313+ req .localDate ()
314+ ));
315+
316+ return new ResponseEntity <>(HttpStatus .OK );
317+ }
318+
319+ @ Operation (summary = "캘린더 플랜 삭제 API" ,
320+ description = "캘린더 플랜을 삭제합니다. 해당 플랜을 찾지 못하면 404 코드를 반환합니다" )
321+ @ ApiResponses (value = {
322+ @ ApiResponse (responseCode = "200" , description = "플랜 수정 성공"
323+ ),
324+ @ ApiResponse (responseCode = "404" , description = "플랜 아이디가 잘못됨" ,
325+ content = @ Content (schema = @ Schema (implementation = ErrorResult .class ))
326+ )
327+ })
328+ @ Parameter (name = "id" , description = "캘린더 플랜의 id" , required = true )
329+ @ PostMapping ("/plan/{id}/delete" )
330+ public ResponseEntity <?> deletePlan (@ PathVariable Long id ){
331+
332+ calendarService .deleteCalendarPlan (id );
333+
334+ return new ResponseEntity <>(HttpStatus .OK );
335+ }
336+
258337 @ Operation (summary = "캘린더 일정 생성 API" ,
259338 description = "캘린더 일정을 생성합니다. 캘린더 태그의 ID가 올바르지 않으면 404 에러를 반환합니다" )
260339 @ ApiResponses (value = {
0 commit comments