mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 20:07:20 +08:00
【新增】redis缓存仓储增加通过Lua脚本查询key的方法,商品增加删除后清理首页缓存的功能。
This commit is contained in:
@@ -15,6 +15,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AutoMate.RedisCache;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.IServices;
|
||||
@@ -58,6 +59,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
private readonly ICoreCmsUserGradeServices _userGradeServices;
|
||||
private readonly ICoreCmsProductsDistributionServices _productsDistributionServices;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -76,7 +78,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
, ICoreCmsGoodsCategoryExtendServices categoryExtendServices
|
||||
, ICoreCmsLabelServices labelServices
|
||||
, ICoreCmsProductsDistributionServices productsDistributionServices
|
||||
, ICoreCmsGoodsTypeSpecServices goodsTypeSpecServices)
|
||||
, ICoreCmsGoodsTypeSpecServices goodsTypeSpecServices, IRedisOperationRepository redisOperationRepository)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_coreCmsGoodsServices = coreCmsGoodsServices;
|
||||
@@ -92,6 +94,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
_labelServices = labelServices;
|
||||
_productsDistributionServices = productsDistributionServices;
|
||||
_goodsTypeSpecServices = goodsTypeSpecServices;
|
||||
_redisOperationRepository = redisOperationRepository;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
@@ -531,6 +534,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
await _productsServices.UpdateAsync(p => new CoreCmsProducts() { isDel = true },
|
||||
p => p.goodsId == model.id);
|
||||
await _redisOperationRepository.LikeRemoveAsync("SqlSugarDataCache.GoodListDTO." + "*");
|
||||
}
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
Reference in New Issue
Block a user