generated from pricelees/issue-pr-template
<!-- 제목 양식 --> <!-- [이슈번호] 작업 요약 (예시: [#10] Gitea 템플릿 생성) --> ## 📝 관련 이슈 및 PR **PR과 관련된 이슈 번호** - #44 ## ✨ 작업 내용 <!-- 어떤 작업을 했는지 알려주세요! --> - 매장 기능 도입 및 기존 기능에 적용 - 관리자 타입(본사, 매장, 전체) 분리 및 API별 적용 ## 🧪 테스트 <!-- 어떤 테스트를 생각했고 진행했는지 알려주세요! --> - 신규 기능 및 매장 기능 도입으로 수정된 기존 API 모두 통합 테스트 완료 ## 📚 참고 자료 및 기타 <!-- 참고한 자료, 또는 논의할 사항이 있다면 알려주세요! --> - 아직 미결제 예약 스케쥴링 작업 등 추가적인 작업이 필요하긴 하지만, 이 작업들은 배포 후 추가로 진행할 예정 - 다음 작업은 배포 + 초기 데이터 삽입 Reviewed-on: #45 Co-authored-by: pricelees <priceelees@gmail.com> Co-committed-by: pricelees <priceelees@gmail.com>
36 lines
1.2 KiB
Kotlin
36 lines
1.2 KiB
Kotlin
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<CommonApiResponse<Unit>> {
|
|
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<CommonApiResponse<ScheduleWithThemeListResponse>> {
|
|
val response = scheduleService.getStoreScheduleByDate(storeId, date)
|
|
|
|
return ResponseEntity.ok(CommonApiResponse(response))
|
|
}
|
|
}
|