我正在处理一个 spring-boot 项目,
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
Run Code Online (Sandbox Code Playgroud)
我怎样才能检查..:
您能向我解释一下 Eclipse IDE 中检查此问题的良好工作流程吗?
首先,我有一个像这样公开的 REST URL:
@PostMapping("/check/existence")
@ResponseBody
public Map<String, MyObjectDto> checkExistence() {
//some code
Run Code Online (Sandbox Code Playgroud)
然后,我有一个带有 Spring WebClient 的消费者,如下所示:
ClientResponse response = webclient.post().uri....
Run Code Online (Sandbox Code Playgroud)
我想做这样的事情:
Map<String, MyObjectDto> responseDto =
response.bodyToMono(Map.class).block();
Run Code Online (Sandbox Code Playgroud)
但控制台返回给我
java.util.LinkedHashMap cannot be cast to org.mypackage.MyObjectDto
Run Code Online (Sandbox Code Playgroud)
那么,我如何使用类似这样的地图Map<String, MyObjectDto>?
consuming ×1
dictionary ×1
hibernate ×1
java ×1
spring-boot ×1
spring-data ×1
version ×1
webclient ×1