提交 aa654b08 作者: xiaowang

新增:用户删除时对应把商品也删除

上级 6a501d5f
......@@ -80,4 +80,11 @@ public class MallGoodsController extends BaseController {
public ResultBody removeMallGoods(@ApiParam(value = "商品id", required = true) @RequestParam(value = "id") Integer id) {
return mallGoodsService.removeMallGoods(id);
}
@ApiOperation(value = "删除用户时对应的商品也删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("feignRemoveGoodsByBackUserAccountId")
public ResultBody feignRemoveGoodsByUserAccountId(@RequestParam(value = "id") Integer id) {
return mallGoodsService.feignRemoveGoodsByBackUserAccountId(id);
}
}
......@@ -61,4 +61,6 @@ public interface MallGoodsDao {
void updateMallGoodsByShelf(Integer id, Integer status);
void removeMallGoods(Integer id);
void feignRemoveGoodsByBackUserAccountId(Integer id);
}
......@@ -26,4 +26,6 @@ public interface MallGoodsService {
ResultBody upOrDownShelf(Integer id, Integer status);
ResultBody removeMallGoods(Integer id);
ResultBody feignRemoveGoodsByBackUserAccountId(Integer id);
}
......@@ -250,4 +250,10 @@ public class MallGoodsServiceImpl implements MallGoodsService {
mallGoodsDao.removeMallGoods(id);
return ResultBody.success();
}
@Override
public ResultBody feignRemoveGoodsByBackUserAccountId(Integer id) {
mallGoodsDao.feignRemoveGoodsByBackUserAccountId(id);
return ResultBody.success();
}
}
......@@ -100,6 +100,11 @@
set is_deleted = 1
where id = #{id}
</update>
<update id="feignRemoveGoodsByBackUserAccountId">
update mall_goods
set is_deleted = 1
where user_account_id = #{id}
</update>
<delete id="deleteMallGoodsResources">
delete
from mall_goods_resources
......
......@@ -22,3 +22,4 @@ data-filter:
- /pms/category/appCategoryInfo
- /pms/app/goods/queryBrandGoods
- /pms/app/goods/queryGoodsInfoByCategorySub
- /pms/mall/goods/feignRemoveGoodsByBackUserAccountId
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论