用户端商品缓存+商品信息修改缓存自动清空
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
@@ -34,4 +35,11 @@ public class ProdRefundToStockParam implements Serializable {
|
||||
@Min(value = 0, message = "是否退回库存值必须是0或1", groups = DefaultGroup.class)
|
||||
@Max(value = 1, message = "是否退回库存值必须是0或1", groups = DefaultGroup.class)
|
||||
private Integer isReturn;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -39,4 +40,10 @@ public class ProductIsSaleParam implements Serializable {
|
||||
@NotNull(message = "是否上下架不能为空", groups = DefaultGroup.class)
|
||||
private Integer isSale;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
@@ -43,4 +44,10 @@ public class ProductIsSoldOutParam implements Serializable {
|
||||
@Max(value = 1, message = "是否售罄必须是0或1", groups = DefaultGroup.class)
|
||||
private Integer isSoldOut;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,16 +14,18 @@ public interface ProductRpcService {
|
||||
/**
|
||||
* 订单支付成功扣减库存
|
||||
*
|
||||
* @param shopId 店铺ID
|
||||
* @param orderId 订单ID
|
||||
* @param dataList 库存扣减数据
|
||||
*/
|
||||
void paySuccessSubtractStock(Long orderId, List<Map<String, Object>> dataList);
|
||||
void paySuccessSubtractStock(Long shopId, Long orderId, List<Map<String, Object>> dataList);
|
||||
|
||||
/**
|
||||
* 订单取消后恢复库存
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param orderId 订单ID
|
||||
* @param dataList 库存恢复数据
|
||||
*/
|
||||
void orderCancelRecoverStock(Long orderId, List<Map<String, Object>> dataList);
|
||||
void orderCancelRecoverStock(Long shopId, Long orderId, List<Map<String, Object>> dataList);
|
||||
}
|
||||
|
||||
@@ -58,9 +58,10 @@ public interface ProductService extends IService<Product> {
|
||||
/**
|
||||
* 删除商品
|
||||
*
|
||||
* @param shopId 店铺ID
|
||||
* @param id 商品ID
|
||||
*/
|
||||
void deleteProduct(Long id);
|
||||
void deleteProduct(Long shopId, Long id);
|
||||
|
||||
/**
|
||||
* 上架/下架商品
|
||||
|
||||
@@ -20,15 +20,17 @@ public interface UProductService extends IService<Product> {
|
||||
/**
|
||||
* 用户端获取热门商品
|
||||
*
|
||||
* @param shopId 店铺ID
|
||||
* @return 热门商品
|
||||
*/
|
||||
List<ShopProductVo> queryHotsProductList();
|
||||
List<ShopProductVo> queryHotsProductList(Long shopId);
|
||||
|
||||
/**
|
||||
* 用户端获取分组商品
|
||||
* @param shopId 店铺ID
|
||||
* @return 分组商品
|
||||
*/
|
||||
List<ShopGroupProductVo> queryGroupProductList();
|
||||
List<ShopGroupProductVo> queryGroupProductList(Long shopId);
|
||||
|
||||
/**
|
||||
* 用户端获取商品详情
|
||||
|
||||
Reference in New Issue
Block a user