@Bean
public RouterFunction<ServerResponse> doctorRoutes(DoctorHandler handler) {
return RouterFunctions.route()
.POST("/doctors/cart",accept(MediaType.APPLICATION_JSON),handler::addCart)
.path("/doctors",b1 -> b1
.POST("/patient/{id}", accept(MediaType.APPLICATION_JSON), handler::addPatient)
.GET("/patients/{d_id}",accept(MediaType.APPLICATION_JSON),handler::getPatientsByDoctorId)
.POST( handler::save)
)
.build();
上面的代码,如果把post请求/doctors/cart
下移到path方法下面时会发生请求进入path方法的save
处理方法中,实际调用的路径为post请求/doctors
来自为知笔记(Wiz)
标签:route,webFlux,accept,APPLICATION,handler,doctors,path,post From: https://www.cnblogs.com/baiyifengyun/p/17094310.html