苍穹外卖--清空购物车

This commit is contained in:
2025-11-24 16:42:46 +08:00
parent a79ed0b649
commit c9ca2dc39a
4 changed files with 28 additions and 0 deletions

View File

@@ -15,4 +15,9 @@ public interface ShoppingCartService {
查看购物车
*/
List<ShoppingCart> showShoppingCart();
/*
清空购物车
*/
void cleanShoppingCart();
}

View File

@@ -104,4 +104,13 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
return shoppingCartMapper.list(cart);
}
/*
清空购物车
*/
@Override
public void cleanShoppingCart() {
shoppingCartMapper.deleteByUserId(BaseContext.getCurrentId());
}
}