Skip to content

Commit

Permalink
feat: 캘린더 조회 컨트롤러 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwon83 committed Feb 8, 2025
1 parent 534d9cf commit 0c7874c
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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, "달력 조회에 성공했습니다.");
}

}

0 comments on commit 0c7874c

Please sign in to comment.