| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public String drawInviteQrCodeNew(String url, Long uid, String portrait, Integer pX, Integer pY, Integer size,
|
| | | public String drawInviteQrCodeNew(InputStream urlInputStream, String urlMd5, Long uid, String portrait, Integer pX, Integer pY, Integer size,
|
| | | String inviteCode) throws IOException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(url)) {
|
| | | if (urlInputStream == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | String erCodeTempPath = null;
|
| | | InputStream erCodeInputStream = null; // 二维码
|
| | | InputStream portraitInputStream = null; // 头像
|
| | | InputStream urlInputStream = HttpUtil.getAsInputStream(url); // 背景
|
| | | // InputStream urlInputStream = HttpUtil.getAsInputStream(url); // 背景
|
| | |
|
| | | String uuid = UUID.randomUUID().toString().replace("-", "");
|
| | | if (uid == null) {
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | urlInputStream = HttpUtil.getAsInputStream(url); // 背景
|
| | | portraitInputStream = HttpUtil.getAsInputStream(portrait); // 头像
|
| | | erCodeInputStream = new FileInputStream(new File(erCodeTempPath)); // 二维码
|
| | | }
|
| | |
| | |
|
| | | // 上传文件相对位置
|
| | | if (new File(targetPath).exists() && new File(targetPath).length() > 0) {
|
| | | int index = url.lastIndexOf("/");
|
| | | String newUrl = url.substring(index + 1);
|
| | | String urlMd5 = newUrl.substring(0, newUrl.lastIndexOf("."));
|
| | | String fileUrl = null;
|
| | | if (uid == null) {
|
| | | fileUrl = "ercode/" + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|