| | |
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | String imgUrl = COSManager.getInstance()
|
| | | .uploadFile(new File(targetPath),
|
| | | "ercode/" + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg")
|
| | | FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg")
|
| | | .getUrl();
|
| | |
|
| | | if (new File(erCodeTempPath).exists())
|
| | |
| | | String newUrl = url.substring(index + 1);
|
| | | String urlMd5 = newUrl.substring(0, newUrl.lastIndexOf("."));
|
| | |
|
| | | String imgUrl = COSManager.getInstance()
|
| | | .uploadFile(new File(targetPath), "ercode/" + "ercode_" + uid + "_" + urlMd5 + ".jpg").getUrl();
|
| | | String imgUrl = COSManager.getInstance().uploadFile(new File(targetPath), |
| | | FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + urlMd5 + ".jpg").getUrl();
|
| | |
|
| | | if (new File(erCodeTempPath).exists())
|
| | | new File(erCodeTempPath).delete();
|
| | |
| | | if (new File(targetPath).exists() && new File(targetPath).length() > 0) {
|
| | | String fileUrl = null;
|
| | | if (uid == null) {
|
| | | fileUrl = "ercode/" + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | fileUrl = FilePathEnum.invitePictureDemo.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | } else {
|
| | | fileUrl = "ercode/" + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | }
|
| | |
|
| | | // 上传文件
|
| | |
| | | // 上传文件相对位置
|
| | | String fileUrl = null;
|
| | | if (uid == null) {
|
| | | fileUrl = "ercode/" + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | fileUrl = FilePathEnum.invitePictureDemo.getPath() + "ercode_" + uuid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | } else {
|
| | | fileUrl = "ercode/" + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | fileUrl = FilePathEnum.ercode.getPath() + "ercode_" + uid + "_" + System.currentTimeMillis() + "_" + urlMd5 + ".jpg";
|
| | | }
|
| | |
|
| | | // 上传
|
| | |
| | | InputStream drawStream = ImageUtil.drawGoodsShareSingle(erCodeStream, portraitStream, goods);
|
| | | // 上传位置
|
| | | String uuid = UUID.randomUUID().toString().replace("-", "");
|
| | | String upPath = "sharegoods/xcx/poster" + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png";
|
| | | String upPath = FilePathEnum.shareXCX.getPath() + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png";
|
| | | // 上传文件
|
| | | return COSManager.getInstance().uploadInputStream(drawStream, upPath);
|
| | | }
|
| | |
| | | InputStream drawStream = ImageUtil.drawGoodsShareXCX(erCodeStream, user, goods);
|
| | | // 上传位置
|
| | | String uuid = UUID.randomUUID().toString().replace("-", "");
|
| | | String upPath = "sharegoods/xcx/poster" + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png";
|
| | | String upPath = FilePathEnum.shareXCX.getPath() + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png";
|
| | | // 上传文件
|
| | | return COSManager.getInstance().uploadInputStream(drawStream, upPath);
|
| | | }
|