gongdecai 1 year ago
parent
commit
c9a45bc3f4

+ 3 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/IGubiTypeInfoService.java

@@ -21,6 +21,9 @@ import java.util.List;
  */
 @HttpOpenApi(group = "admin.gubi.gubiTypeInfo", description = "一级分类")
 public interface IGubiTypeInfoService {
+    @HttpMethod(description = "清缓存")
+    public void clearCache();
+
     @HttpMethod(description = "新增")
     public Boolean add(@NotNull @HttpParam(name = "gubiTypeInfo", type = HttpParamType.COMMON, description = "一级分类") GubiTypeInfo gubiTypeInfo,
                        @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "adminId") Long adminId) throws ServiceException;

+ 10 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/gubi/impl/GubiTypeInfoServiceImpl.java

@@ -44,6 +44,16 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
     private GubiTypeThreeMapper gubiTypeThreeMapper;
     @Autowired
     private CacheComponent cacheComponent;
+
+
+    //清理所有Redis缓存
+    public void clearCache() {
+        cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
+        cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_BI_INFO);
+    }
     @Override
     public Boolean add(GubiTypeInfo gubiTypeInfo, Long adminId) throws ServiceException {
         Date now = new Date();