|
@@ -125,6 +125,13 @@ public class GoodsController extends AbstractController{
|
|
|
if(goods.getName().length() > 15){
|
|
|
return Result.failure("商品名称名称不能超过15个字符");
|
|
|
}
|
|
|
+ if(StringUtils.isEmpty(goods.getBrandId())){
|
|
|
+ throw new RRException("直播间id为空");
|
|
|
+ }
|
|
|
+ BrandEntity brand = brandService.queryObject(goods.getBrandId());
|
|
|
+ if(brand == null){
|
|
|
+ throw new RRException("直播间为空");
|
|
|
+ }
|
|
|
goodsService.save(goods);
|
|
|
//发送数据给api平台
|
|
|
sendDataToApi(goods);
|
|
@@ -336,6 +343,13 @@ public class GoodsController extends AbstractController{
|
|
|
if(null == goodsEntity){
|
|
|
return Result.failure("商品不存在");
|
|
|
}
|
|
|
+ if(StringUtils.isEmpty(goods.getBrandId())){
|
|
|
+ throw new RRException("直播间id为空");
|
|
|
+ }
|
|
|
+ BrandEntity brand = brandService.queryObject(goods.getBrandId());
|
|
|
+ if(brand == null){
|
|
|
+ throw new RRException("直播间为空");
|
|
|
+ }
|
|
|
goodsService.update(goods);
|
|
|
|
|
|
//发送数据给api平台
|