| | |
| | | @Override |
| | | public String createActivityCode(String url, String fileName) throws Exception { |
| | | File qrCodeFile = new File("/home/image/qrcode.png");// 生成二维码 |
| | | QrCodeUtil.generate(url, 100, 100, qrCodeFile); |
| | | QrCodeUtil.generate(url, 300, 300, qrCodeFile); |
| | | InputStream codeStream = new FileInputStream(qrCodeFile); |
| | | String fileUrl = OBSUploadUtils.uploadInputStream(codeStream,fileName); |
| | | codeStream.close(); |
| | | return fileUrl; |
| | | } |
| | | |
| | |
| | | String fileUrl = null; |
| | | File qrCodeFile = new File("/home/image/qrcode.png"); |
| | | // 二维码内容 |
| | | String text = "https://wxapp.hhhrt.cn/mini/activity?"+activityId; |
| | | String text = "https://wxapp.hhhrt.cn/mini/activity?id="+activityId; |
| | | // 生成二维码 |
| | | QrCodeUtil.generate(text, 200, 200, qrCodeFile); |
| | | ByteArrayOutputStream out = new ByteArrayOutputStream(); |
| | |
| | | ); |
| | | InputStream inputStream = new ByteArrayInputStream(out.toByteArray()); |
| | | fileUrl = OBSUploadUtils.uploadInputStream(inputStream,activityId); |
| | | codeStream.close(); |
| | | inputStream.close(); |
| | | return fileUrl; |
| | | } |
| | | } |