|
5 | 5 | import com.clubber.ClubberServer.domain.calendar.dto.GetCalendarResponse; |
6 | 6 | import com.clubber.ClubberServer.domain.calendar.dto.UpdateCalendarRequest; |
7 | 7 | import com.clubber.ClubberServer.domain.calendar.entity.Calendar; |
8 | | -import com.clubber.ClubberServer.domain.calendar.service.AdminCalendarService; |
| 8 | +import com.clubber.ClubberServer.domain.calendar.service.CalendarAdminService; |
9 | 9 | import com.clubber.ClubberServer.global.common.page.PageResponse; |
| 10 | +import io.swagger.v3.oas.annotations.Operation; |
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; |
10 | 12 | import lombok.RequiredArgsConstructor; |
11 | 13 | import org.springframework.data.domain.Pageable; |
12 | 14 | import org.springframework.web.bind.annotation.*; |
13 | 15 |
|
14 | 16 | @RestController |
15 | 17 | @RequiredArgsConstructor |
16 | 18 | @RequestMapping("/api/v1/admins/calendars") |
17 | | -public class CalendarController { |
18 | | - private final AdminCalendarService calendarService; |
| 19 | +@Tag(name = "[관리자 캘린더 관련 API]") |
| 20 | +public class CalendarAdminController { |
| 21 | + private final CalendarAdminService calendarService; |
19 | 22 |
|
20 | 23 | @PostMapping |
| 24 | + @Operation(summary = "미연동 캘린더 생성") |
21 | 25 | public CreateCalendarResponse createCalendar(@RequestBody CreateCalendarRequest request) { |
22 | 26 | return calendarService.createCalendar(request); |
23 | 27 | } |
24 | 28 |
|
25 | 29 | @GetMapping |
| 30 | + @Operation(summary = "캘린더 목록 (페이지) 조회") |
26 | 31 | public PageResponse<Calendar> getCalendars(Pageable pageable) { |
27 | 32 | return calendarService.getCalenderPages(pageable); |
28 | 33 | } |
29 | 34 |
|
30 | 35 | @GetMapping("/{id}") |
| 36 | + @Operation(summary = "특정 캘린더 (단일) 조회") |
31 | 37 | public GetCalendarResponse getCalendar(@PathVariable Long id) { |
32 | 38 | return calendarService.getCalendar(id); |
33 | 39 | } |
34 | 40 |
|
35 | 41 | @PatchMapping("/{id}") |
| 42 | + @Operation(summary = "특정 캘린더 수정") |
36 | 43 | public void updateCalendar(@PathVariable Long id, @RequestBody UpdateCalendarRequest request) { |
37 | 44 | calendarService.updateCalendar(request, id); |
38 | 45 | } |
39 | 46 |
|
40 | | - @DeleteMapping("/calendars/{id}") |
| 47 | + @DeleteMapping("/{id}") |
| 48 | + @Operation(summary = "특정 캘린더 삭제") |
41 | 49 | public void deleteCalendar(@PathVariable Long id) { |
42 | 50 | calendarService.deleteCalendar(id); |
43 | 51 | } |
|
0 commit comments