商品模块代码提交

This commit is contained in:
Tankaikai
2025-02-17 10:12:45 +08:00
parent a6175be737
commit 4b725c36c8
11 changed files with 10 additions and 54 deletions

View File

@@ -147,25 +147,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
@Override
public boolean deleteProduct(Long id) {
Long shopId = StpKit.USER.getLoginIdAsLong();
return super.remove(query().eq(Product::getId, id).eq(Product::getShopId, shopId));
}
@Override
public boolean disableProduct(Long id) {
Long shopId = StpKit.USER.getLoginIdAsLong();
return UpdateChain.of(Product.class)
//.set(Product::getStatus, StatusEnum.DISABLE.value())
.eq(Product::getId, id)
.eq(Product::getShopId, shopId)
.update();
}
@Override
public boolean enableProduct(Long id) {
Long shopId = StpKit.USER.getLoginIdAsLong();
return UpdateChain.of(Product.class)
//.set(Product::getStatus, StatusEnum.ENABLED.value())
.set(Product::getIsDel, DeleteEnum.DELETED.value())
.eq(Product::getId, id)
.eq(Product::getShopId, shopId)
.update();