-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...ion/wypl-core/src/main/java/com/wypl/wyplcore/calendar/controller/CalendarController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, "달력 조회에 성공했습니다."); | ||
} | ||
|
||
} |