From 0c7874cd41e3120140a2b0fd406b6fba16fc6f33 Mon Sep 17 00:00:00 2001 From: jiwonhan Date: Sat, 8 Feb 2025 17:24:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BA=98=EB=A6=B0=EB=8D=94=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CalendarController.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 application/wypl-core/src/main/java/com/wypl/wyplcore/calendar/controller/CalendarController.java diff --git a/application/wypl-core/src/main/java/com/wypl/wyplcore/calendar/controller/CalendarController.java b/application/wypl-core/src/main/java/com/wypl/wyplcore/calendar/controller/CalendarController.java new file mode 100644 index 0000000..46464ef --- /dev/null +++ b/application/wypl-core/src/main/java/com/wypl/wyplcore/calendar/controller/CalendarController.java @@ -0,0 +1,36 @@ +package com.wypl.wyplcore.calendar.controller; + +import java.time.LocalDate; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import com.wypl.applicationcommon.WyplResponseEntity; +import com.wypl.googleoauthclient.annotation.Authenticated; +import com.wypl.googleoauthclient.domain.AuthMember; +import com.wypl.wyplcore.calendar.data.response.CalendarSchedulesResponse; +import com.wypl.wyplcore.calendar.service.CalendarService; +import com.wypl.wyplcore.schedule.data.CalendarType; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@RequestMapping("/calendar") +public class CalendarController { + private final CalendarService calendarService; + + @GetMapping + public WyplResponseEntity getCalendar( + @Authenticated AuthMember authMember, + @PathVariable("calendarId") int calendarId, + @RequestParam("type") CalendarType calendarType, + @RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate today + ) { + CalendarSchedulesResponse response = calendarService.findCalendar(authMember, calendarId, calendarType, today); + return WyplResponseEntity.ok(response, "달력 조회에 성공했습니다."); + } + +}