@@ -0,0 +1,1910 @@
+package com.fil.ap.zxing;%0A%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport javax.imageio.ImageIO;%0A%0Aimport org.springframework.context.annotation.Profile;%0Aimport org.springframework.http.HttpHeaders;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RequestParam;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0Aimport com.google.zxing.BarcodeFormat;%0Aimport com.google.zxing.EncodeHintType;%0Aimport com.google.zxing.MultiFormatWriter;%0Aimport com.google.zxing.client.j2se.MatrixToImageWriter;%0Aimport com.google.zxing.common.BitMatrix;%0A%0A@RestController%0A@Profile(%7B %22uat%22 %7D)%0Apublic class QRCodeController %7B%0A%0A%09@RequestMapping(value = %22/urlqrcode%22, method = RequestMethod.GET)%0A%09public ResponseEntity%3Cbyte%5B%5D%3E urlQRCode(%0A%09%09%09@RequestParam(required = true)String id%0A%09%09)  throws Exception %7B  %0A%09%09%0A%09%09String url = %22https://www.fidelity.com.hk/investor/%22;%0A%09%09%0A%09%09int width = 256;%0A%09%09int height = 256;%0A%09%09String format = %22png%22;%0A%09%09%0A%09%09Map%3CEncodeHintType, Object%3E hints = new HashMap%3CEncodeHintType, Object%3E();%0A%09%09%0A%09%09hints.put(EncodeHintType.CHARACTER_SET, %22UTF-8%22);%0A%09%09%0A%09%09BitMatrix bitMatrix = new MultiFormatWriter().encode(%0A%09%09%09%09url, %0A%09%09%09%09BarcodeFormat.QR_CODE, %0A%09%09%09%09width, %0A%09%09%09%09height, %0A%09%09%09%09hints%0A%09%09);%0A%09%09%0A%0A%09%09BufferedImage image = MatrixToImageWriter.toBufferedImage(bitMatrix);%0A%09%09%0A%09%09ByteArrayOutputStream out = new ByteArrayOutputStream();%0A%09%09ImageIO.write(image, format, out);%0A%09%09%0A%09%09HttpHeaders headers = new HttpHeaders();%0A%09%09headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);%0A%09%09%0A%09%09return new ResponseEntity%3Cbyte%5B%5D%3E(out.toByteArray(), headers, HttpStatus.CREATED);%0A%09%7D%0A%7D%0A

add qrcode url