How to convert or write below java code to reactive webflux using map & flatMap . And i need the
(ResponseEntity
public ResponseEntity<byte[]> printQRVCT() throws JRException, IOException {
System.out.println("printQRVCT-------------------called");
Map<String, Object> vehiclePassParams = new HashMap<>();
vehiclePassParams.put("jobNumber", "JOB1");
String jasperFilePath = "classpath:reports/VehiclePassQRCode.jrxml";
JasperPrint jasperPrint = JasperReportGenerator.buildJasperReport(jasperFilePath, vehiclePassParams);
String fileName = "VehiclePassQRCode.pdf";
httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_PDF);
httpHeaders.setContentDispositionFormData("fileName", fileName);`your text`
return new ResponseEntity<byte[]>(JasperExportManager.exportReportToPdf(jasperPrint), httpHeaders,HttpStatus.OK);
需要使用 map & flatmap 转换为 webflux
need to convert as webflux using map & flatmap