【发布时间】:2021-03-25 10:11:32
【问题描述】:
关于使用Mono<ServerResponse> vs Mono<ResponseEntity<MyPojo>> 作为返回类型的小问题。
我看到了一些例子,有时,Mono<ServerResponse> 在 Spring Webflux 的功能路由中用作返回类型。
但也看到了一些例子,有时,Mono<ResponseEntity<MyPojo>> 被用作 Spring 功能路由中的返回类型。
此外,Mono<ResponseEntity<MyPojo>> 在@Controller 中使用的例子很多,@RequestMapping (Get, Post mapping etc...) 作为返回类型。
但也有少数例子返回Mono<ServerResponse>。
请问,退货有什么区别?
【问题讨论】:
标签: java spring-webflux