这是一个controller方法的尾巴,方法上的返回值是void
请问这个注解中的属性和下面那段代码表示的什么意思
“JsonParam”和“cfg.getJsonParam()”表示的是项目里的一个属性类,不用在意
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) public void upload(。。。。。。。。
HttpHeaders headers = new HttpHeaders();
MediaType mediaType = new MediaType("application", "merge-patch+json");
headers.setContentType(mediaType);
HttpEntity<JsonParam> entity = new HttpEntity<>(cfg.getJsonParam(), headers);
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
RestTemplate restTemplate = new RestTemplate(requestFactory);为了看的方便我把包放出来
import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate;
米琪卡哇伊
阿晨1998
随时随地看视频慕课网APP
相关分类