| | |
| | | } |
| | | |
| | | @Override |
| | | public UserCloudGoods addGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException { |
| | | public UserCloudGoods addGoods(Long uid, String goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException { |
| | | if (uid == null) |
| | | throw new UserCloudGoodsException(1, "用户尚未登录"); |
| | | if (goodsId == null || goodsType == null) |
| | |
| | | throw new UserCloudGoodsException(1, goodsId + "商品已下架"); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { // 京东 |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong( goodsId)); |
| | | if (goods == null) |
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息"); |
| | | commonGoods = CommonGoodsFactory.create(goods); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { // 拼多多 |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (goods == null) |
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息"); |
| | | commonGoods = CommonGoodsFactory.create(goods); |