直播间去重复商品
This commit is contained in:
parent
788e9ca239
commit
d047546374
@ -320,6 +320,11 @@ public enum ResultCode {
|
||||
|
||||
FULL_DISCOUNT_EDIT_DELETE(43002, "删除满优惠活动成功"),
|
||||
|
||||
/**
|
||||
* 直播
|
||||
*/
|
||||
STODIO_GOODS_EXIST_ERROR(44001,"直播商品已存在"),
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
|
@ -152,6 +152,14 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
||||
|
||||
@Override
|
||||
public Boolean push(Integer roomId, Integer goodsId) {
|
||||
|
||||
//判断直播间是否已添加商品
|
||||
if(studioCommodityService.getOne(
|
||||
new LambdaQueryWrapper<StudioCommodity>().eq(StudioCommodity::getRoomId,roomId)
|
||||
.eq(StudioCommodity::getGoodsId,goodsId))!=null){
|
||||
throw new ServiceException(ResultCode.STODIO_GOODS_EXIST_ERROR);
|
||||
}
|
||||
|
||||
//调用微信接口添加直播间商品并进行记录
|
||||
if (wechatLivePlayerUtil.pushGoods(roomId, goodsId)) {
|
||||
studioCommodityService.save(new StudioCommodity(roomId, goodsId));
|
||||
|
Loading…
x
Reference in New Issue
Block a user