package roomescape.schedule.web import org.springframework.format.annotation.DateTimeFormat import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.* import roomescape.common.dto.response.CommonApiResponse import roomescape.schedule.business.ScheduleService import roomescape.schedule.docs.PublicScheduleAPI import roomescape.schedule.docs.UserScheduleAPI import java.time.LocalDate @RestController class ScheduleController( private val scheduleService: ScheduleService ) : UserScheduleAPI, PublicScheduleAPI { @PostMapping("/schedules/{id}/hold") override fun holdSchedule( @PathVariable("id") id: Long ): ResponseEntity> { scheduleService.holdSchedule(id) return ResponseEntity.ok(CommonApiResponse()) } @GetMapping("/stores/{storeId}/schedules") override fun getStoreSchedulesByDate( @PathVariable("storeId") storeId: Long, @RequestParam("date") @DateTimeFormat(pattern = "yyyy-MM-dd") date: LocalDate ): ResponseEntity> { val response = scheduleService.getStoreScheduleByDate(storeId, date) return ResponseEntity.ok(CommonApiResponse(response)) } }