//package cn.flightfeather.supervision.lightshare.web
|
//
|
//import cn.flightfeather.supervision.domain.ds1.entity.TaskVo
|
//import cn.flightfeather.supervision.lightshare.repository.TaskRepository
|
//import org.springframework.context.annotation.Bean
|
//import org.springframework.context.annotation.Configuration
|
//import org.springframework.web.reactive.function.server.ServerResponse
|
//import org.springframework.web.reactive.function.server.bodyToMono
|
//import org.springframework.web.reactive.function.server.router
|
//import reactor.core.publisher.toMono
|
//
|
////@Configuration
|
//class TaskConfiguration(val taskRepository: TaskRepository) {
|
//// @Bean
|
//// fun routesTask() = router {
|
//// GET("/tasks", { ServerResponse.ok().body(taskRepository.findAll(), TaskVo::class.java) })
|
////// POST("/tasks", { ServerResponse.ok().body("hello world".toMono(), String::class.java) })
|
//// GET("/tasks/{id}", { ServerResponse.ok().body(taskRepository.findOne(it.pathVariable("id")), TaskVo::class.java) })
|
//// PUT("/tasks", { ServerResponse.ok().body(taskRepository.save(it.bodyToMono(TaskVo::class.java)), Int::class.java)})
|
//// PUT("/test", { ServerResponse.ok().body(taskRepository.test(it),Int::class.java)})
|
//// }
|
//}
|