| | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public int insert(UserShareGoodsRecord record) {
|
| | | return userShareGoodsRecordMapper.insert(record);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void saveSingleShareRecord(Long uid, Long goodsId, Integer goodsType)
|
| | | throws UserShareGoodsRecordException {
|
| | | public void saveSingleShareRecord(Long uid, Long goodsId, Integer goodsType) throws UserShareGoodsRecordException {
|
| | | if (goodsId == null) {
|
| | | throw new UserShareGoodsRecordException(1, "分享商品不能为空");
|
| | | }
|
| | |
| | | /**
|
| | | * 生成分享图
|
| | | *
|
| | | * @param uid 用户id
|
| | | * @param shareId 分享记录id
|
| | | * @param source 来源
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param shareId
|
| | | * 分享记录id
|
| | | * @param source
|
| | | * 来源
|
| | | * @param listGoods
|
| | | * @return
|
| | | * @throws UserShareGoodsRecordException
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException {
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin)
|
| | | throws UserShareGoodsRecordException {
|
| | | if (auctionId == null || uid == null || uid <= 0) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ShareGoodsRecordDTO addRecordGoodsStorage(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief, List<Long> listStorageID)
|
| | | throws UserShareGoodsRecordException {
|
| | | public ShareGoodsRecordDTO addRecordGoodsStorage(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief,
|
| | | List<Long> listStorageID) throws UserShareGoodsRecordException {
|
| | | if (uid == null || uid <= 0 || listGoodsBrief == null || listGoodsBrief.size() == 0) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | for (TaoBaoGoodsBrief goodsBrief: listGoodsBrief) {
|
| | | listCommonGoods.add(CommonGoodsFactory.create(goodsBrief));
|
| | | }
|
| | | |
| | |
|
| | | Long id = record.getId();
|
| | | // 分享链接
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ShareGoodsRecordDTO addRecordGoodsStorageV2(Long uid, List<CommonGoods> listGoods, List<Long> listStorageID)
|
| | | throws UserShareGoodsRecordException {
|
| | | public ShareGoodsRecordDTO addRecordGoodsStorageV2(Long uid, List<CommonGoods> listGoods, List<Long> listStorageID,
|
| | | boolean needDrawPicture) throws UserShareGoodsRecordException {
|
| | | if (uid == null || uid <= 0 || listGoods == null || listGoods.size() == 0) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | // 分享链接
|
| | | String shareUrl = getShareUrlV2(record);
|
| | | // 分享二维码链接
|
| | | FileUploadResult uploadResult = drawingSharePicture(uid, id, shareUrl, listGoods);
|
| | |
|
| | | ShareGoodsRecordDTO recordDTO = new ShareGoodsRecordDTO();
|
| | | recordDTO.setUid(uid);
|
| | |
| | | recordDTO.setShareUrl(shareUrl);
|
| | | recordDTO.setListId(listStorageID);
|
| | | recordDTO.setListGoods(listGoods);
|
| | | if (needDrawPicture) {
|
| | | FileUploadResult uploadResult = drawingSharePicture(uid, id, shareUrl, listGoods);
|
| | | recordDTO.setSharePictureUrl(uploadResult.getUrl());
|
| | | }
|
| | | recordDTO.setSource(ShareSourceTypeEnum.storage);
|
| | |
|
| | | // 缓存分享商品信息
|
| | |
| | | return url;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 分享链接
|
| | | *
|
| | |
| | | Long uid = shareRecord.getUid();
|
| | | Long shareId = shareRecord.getId();
|
| | |
|
| | | String url = String.format("http://%s/share_mushGoods_1.6.0.html?uid=%s&shareId=%s",
|
| | | configService.getH5Host(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), shareId + "");
|
| | | String url = String.format("http://%s/share_mushGoods_1.6.0.html?uid=%s&shareId=%s", configService.getH5Host(),
|
| | | AESUtil.encrypt(uid + "", Constant.UIDAESKEY), shareId + "");
|
| | |
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | |
| | | /**
|
| | | * 生成分享图
|
| | | *
|
| | | * @param uid 用户id
|
| | | * @param shareId 分享记录id
|
| | | * @param source 来源
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param shareId
|
| | | * 分享记录id
|
| | | * @param source
|
| | | * 来源
|
| | | * @param listGoods
|
| | | * @return
|
| | | * @throws UserShareGoodsRecordException
|