Slide 26
Slide 26 text
3PVUFS'VODUJPO%4-
@Configuration
class TaskRoutes(private val taskHandler: TaskHandler,
private val exceptionFilter: ExceptionFilter) {
@Bean
fun taskRouter() = router {
(accept(APPLICATION_JSON) and "/api").nest {
"/task".nest {
POST("/", taskHandler::create)
GET("/{id}", taskHandler::fetchByTaskId)
PUT("/{id}", taskHandler::updateByTaskId)
DELETE("/{id}", taskHandler::deleteByTaskId)
PUT("/{id}/finish", taskHandler::finishByTaskId)
}
"/tasks".nest {
GET("/", taskHandler::fetchAll)
}
}
}.filter(exceptionFilter())
}
4QSJOH.7$ʹൺͯγϡοͱ͢Δ
Ξϊςʔγϣϯࠈ͔Β٫
,PUMJOͰ͞Βʹγϡοͱ͢Δ