| | |
| | | singleGoodsShare(userShareGoodsRecord, goodsBrief);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public Long saveSingleShareRecord(Long uid, Long auctionId) throws UserShareGoodsRecordException {
|
| | |
|
| | | if (auctionId == null) {
|
| | | throw new UserShareGoodsRecordException(1, "分享商品不能为空");
|
| | | }
|
| | |
|
| | | if (uid == null) {
|
| | | throw new UserShareGoodsRecordException(1, "用户ID不能为空");
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goodsBrief = null;
|
| | | try {
|
| | | goodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | throw new UserShareGoodsRecordException(1, "商品已下架");
|
| | | }
|
| | |
|
| | | UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord();
|
| | | userShareGoodsRecord.setUid(uid);
|
| | | userShareGoodsRecord.setSource(ShareSourceTypeEnum.goodsDetail);
|
| | | userShareGoodsRecord.setShareState(0);
|
| | | // 单个商品分享
|
| | | singleGoodsShare(userShareGoodsRecord, goodsBrief);
|
| | | |
| | | return userShareGoodsRecord.getId();
|
| | | }
|
| | | |
| | | @Override
|
| | | public void save(Long uid, ShareSourceTypeEnum source, String title, TaoBaoGoodsBrief taoBaoGoodsBrief)
|
| | | throws UserShareGoodsRecordException {
|