优惠券 删除
This commit is contained in:
parent
84a2007b26
commit
065772c2c3
|
|
@ -70,8 +70,8 @@ public class TbShopCouponController {
|
|||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<Object> delete(@RequestParam("id") Integer id) {
|
||||
tbShopCouponService.delete(id);
|
||||
public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
|
||||
tbShopCouponService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public interface TbShopCouponService extends IService<TbShopCoupon> {
|
|||
TbShopCoupon findById (Integer id);
|
||||
|
||||
boolean update(TbShopCouponVo param);
|
||||
boolean delete(Integer id);
|
||||
boolean delete(Integer[] ids);
|
||||
|
||||
ResponseEntity<Object> find(CouponDto param);
|
||||
|
||||
|
|
|
|||
|
|
@ -133,9 +133,11 @@ public class TbShopCouponServiceImpl extends ServiceImpl<TbShopCouponMapper, TbS
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean delete(Integer id) {
|
||||
tbShopCouponmapper.deleteById(id);
|
||||
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
|
||||
public boolean delete(Integer[] ids) {
|
||||
tbShopCouponmapper.deleteBatchIds(Arrays.asList(ids));
|
||||
for (Integer id : ids) {
|
||||
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue