【发布时间】:2019-08-20 16:15:54
【问题描述】:
我不熟悉招摇文档等 请您分享为以下端点创建开放 API 规范的任何好的资源或步骤,该端点是 Spring Boot 微服务的端点:
@PostMapping(path = "/pdf", produces = MediaType.APPLICATION_PDF_VALUE)
public ResponseEntity<ByteArrayResource> createReport(@RequestParam MultipartFile template, @RequestParam MultipartFile templateDataAsJson) throws IOException {
log.info("Triggering PDF Generation and Download");
log.info("Step 1 Starts : Sending Json data to the template data binder microservice: Request:{}", templateDataAsJson);
String completedHtmlJson = restClient.populateTemplate(template, templateDataAsJson);
log.info("Steps 2 Starts: Sending populated html template to html-to-pdf microservice for rendering:{}", completedHtmlJson);
ResponseEntity<ByteArrayResource> response = restClient.html2PdfGeneration(completedHtmlJson);
return ResponseEntity.ok().contentType(APPLICATION_PDF).body(response.getBody());
}
任何帮助或参考将不胜感激。 谢谢大家。
【问题讨论】:
标签: spring-boot swagger-2.0 openapi swagger-codegen openapi-generator