|
7 | 7 | import org.springframework.security.core.annotation.AuthenticationPrincipal; |
8 | 8 | import org.springframework.web.bind.annotation.GetMapping; |
9 | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| 10 | +import org.springframework.web.bind.annotation.PostMapping; |
10 | 11 | import org.springframework.web.bind.annotation.PutMapping; |
11 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
12 | 13 | import org.springframework.web.bind.annotation.RequestParam; |
|
17 | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
18 | 19 | import lombok.RequiredArgsConstructor; |
19 | 20 | import server.yakssok.domain.medication_schedule.application.service.MedicationScheduleService; |
| 21 | +import server.yakssok.domain.medication_schedule.batch.job.MedicationScheduleJob; |
20 | 22 | import server.yakssok.domain.medication_schedule.presentation.dto.response.MedicationScheduleGroupResponse; |
21 | 23 | import server.yakssok.global.common.reponse.ApiResponse; |
22 | 24 | import server.yakssok.global.common.security.YakssokUserDetails; |
|
30 | 32 | @Tag(name = "Medication Schedule", description = "복약 스케줄 API") |
31 | 33 | public class MedicationScheduleController { |
32 | 34 | private final MedicationScheduleService medicationScheduleService; |
| 35 | + private final MedicationScheduleJob job; |
33 | 36 |
|
34 | 37 | @Operation(summary = "나의 복약 스케줄 조회 (오늘)") |
35 | 38 | @GetMapping("/today") |
@@ -92,4 +95,9 @@ public ApiResponse<MedicationScheduleGroupResponse> findFriendRangeMedicationSch |
92 | 95 | Long userId = userDetails.getUserId(); |
93 | 96 | return ApiResponse.success(medicationScheduleService.getFriendRangeSchedules(userId, friendId, startDate, endDate)); |
94 | 97 | } |
| 98 | + |
| 99 | + @PostMapping("/backfill/{date}") // yyyy-MM-dd |
| 100 | + public void backfill(@PathVariable String date) { |
| 101 | + job.runFor(LocalDate.parse(date)); |
| 102 | + } |
95 | 103 | } |
0 commit comments