Guest User

Untitled

a guest
Mar 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. @Configuration
  2. public class PersonRouter {
  3.  
  4. @Bean
  5. public RouterFunction<ServerResponse> route(PersonHandler personHandler) {
  6. return RouterFunctions.route(GET("/people/{id}").and(accept(APPLICATION_JSON)), personHandler::get)
  7. .andRoute(GET("/people").and(accept(APPLICATION_JSON)), personHandler::all)
  8. .andRoute(POST("/people").and(accept(APPLICATION_JSON)).and(contentType(APPLICATION_JSON)), personHandler::post)
  9. .andRoute(PUT("/people/{id}").and(accept(APPLICATION_JSON)).and(contentType(APPLICATION_JSON)), personHandler::put)
  10. .andRoute(DELETE("/people/{id}"), personHandler::delete)
  11. .andRoute(GET("/people/country/{country}").and(accept(APPLICATION_JSON)), personHandler::getByCountry);
  12. }
  13. }
Add Comment
Please, Sign In to add comment