👍 删除清理首页缓存的钩子。
This commit is contained in:
@@ -115,7 +115,7 @@ public class BxgIndexController {
|
||||
@GetMapping("/index")
|
||||
@ApiOperation(value = "首页数据",notes = "首页数据")
|
||||
public ApiResult<IndexVo> index(){
|
||||
ArrayList list=new ArrayList<>();
|
||||
List<JSONObject> list=new ArrayList<>();
|
||||
systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_BANNER).forEach(banner->{
|
||||
// 如果没有类型认定为首页图,0也认为是首页图
|
||||
if (banner.get("type")==null||banner.get("type").equals(0)){
|
||||
@@ -135,12 +135,12 @@ public class BxgIndexController {
|
||||
.combinationList(storeCombinationService.getList(1,8).getStoreCombinationQueryVos())
|
||||
.firstList(storeProductService.getList(1,10,ProductEnum.TYPE_3.getValue())) //首发新品
|
||||
.likeInfo(storeProductService.getList(1,80,ProductEnum.TYPE_2.getValue())) //热门榜单
|
||||
.mapKey(systemConfigService.getData(ShopKeyUtils.getTengXunMapKey()))
|
||||
// .mapKey(systemConfigService.getData(ShopKeyUtils.getTengXunMapKey()))
|
||||
//菜单
|
||||
.menus(systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_MENUS))
|
||||
.roll(systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_ROLL_NEWS))
|
||||
.seckillList(storeSeckillService.getList(1, 4))//秒杀商品
|
||||
.liveList(wechatLiveService.getList(1,4,0))
|
||||
// .liveList(wechatLiveService.getList(1,4,0))
|
||||
.build();
|
||||
return ApiResult.ok(indexVo);
|
||||
}
|
||||
|
||||
+4
-4
@@ -85,7 +85,7 @@ public class StoreCombinationController {
|
||||
return new ResponseEntity<>(yxStoreCombinationService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@Log("新增拼团")
|
||||
@ApiOperation(value = "新增拼团")
|
||||
@PostMapping(value = "/yxStoreCombination")
|
||||
@@ -167,7 +167,7 @@ public class StoreCombinationController {
|
||||
productDto.setAttr(productFormatDto);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@Log("修改拼团")
|
||||
@ApiOperation(value = "新增/修改拼团")
|
||||
@PutMapping(value = "/yxStoreCombination")
|
||||
@@ -181,7 +181,7 @@ public class StoreCombinationController {
|
||||
}
|
||||
|
||||
}
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@ApiOperation(value = "开启关闭")
|
||||
@PostMapping(value = "/yxStoreCombination/onsale/{id}")
|
||||
@@ -191,7 +191,7 @@ public class StoreCombinationController {
|
||||
yxStoreCombinationService.onSale(id,status);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除拼团")
|
||||
@ApiOperation(value = "删除拼团")
|
||||
|
||||
@@ -77,7 +77,7 @@ public class StoreSeckillController {
|
||||
}
|
||||
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@Log("发布")
|
||||
@ApiOperation(value = "发布")
|
||||
@PutMapping(value = "/yxStoreSeckill")
|
||||
@@ -91,7 +91,7 @@ public class StoreSeckillController {
|
||||
}
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除")
|
||||
@ApiOperation(value = "删除")
|
||||
@@ -102,7 +102,7 @@ public class StoreSeckillController {
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@Log("新增秒杀")
|
||||
@ApiOperation(value = "新增秒杀")
|
||||
@PostMapping(value = "/yxStoreSeckill")
|
||||
|
||||
+4
-3
@@ -126,8 +126,9 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
||||
yxSystemGroupDataList.forEach(i -> {
|
||||
String jsonStr = i.getValue();
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
int time = Integer.valueOf(jsonObject.get("time").toString());//开启时间(几点) 5
|
||||
int continued = Integer.valueOf(jsonObject.get("continued").toString());//活动持续事件 3
|
||||
|
||||
int time = jsonObject.getInteger("time");//开启时间(几点) 5
|
||||
int continued = jsonObject.getInteger("continued");//活动持续事件 3
|
||||
String rule="";
|
||||
if (jsonObject.get("rule")!=null){
|
||||
rule=jsonObject.get("rule").toString();
|
||||
@@ -162,7 +163,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
||||
seckillTimeDto.setStatus(2);
|
||||
seckillTimeDto.setRule(rule);
|
||||
seckillTimeDto.setStop(OrderUtil.dateToTimestamp(new Date()) + activityEndHour * 3600);
|
||||
} else if (currentHour >= activityEndHour) {
|
||||
} else {
|
||||
seckillTimeDto.setState("已结束");
|
||||
seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00");
|
||||
seckillTimeDto.setStatus(0);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class StoreCategoryController {
|
||||
@Log("新增商品分类")
|
||||
@ApiOperation(value = "新增商品分类")
|
||||
@PostMapping(value = "/yxStoreCategory")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){
|
||||
if(resources.getPid() != null && resources.getPid() > 0 && StrUtil.isBlank(resources.getPic())) {
|
||||
@@ -100,7 +100,7 @@ public class StoreCategoryController {
|
||||
@ForbidSubmit
|
||||
@Log("修改商品分类")
|
||||
@ApiOperation(value = "修改商品分类")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@PutMapping(value = "/yxStoreCategory")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){
|
||||
@@ -125,7 +125,7 @@ public class StoreCategoryController {
|
||||
@ForbidSubmit
|
||||
@Log("删除商品分类")
|
||||
@ApiOperation(value = "删除商品分类")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@DeleteMapping(value = "/yxStoreCategory/{id}")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable String id){
|
||||
|
||||
+2
-2
@@ -430,7 +430,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
* @return YxStoreOrder
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
public YxStoreOrder createOrder(YxUser userInfo, String key, OrderParam param) {
|
||||
|
||||
ComputeVo computeVo = this.computedOrder(userInfo, key, param.getCouponId(),
|
||||
@@ -1054,7 +1054,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
* @param orderId 单号
|
||||
* @param uid uid
|
||||
*/
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@Override
|
||||
public void takeOrder(String orderId, Long uid) {
|
||||
YxStoreOrderQueryVo order = this.getOrderInfo(orderId, uid);
|
||||
|
||||
@@ -140,7 +140,7 @@ public class StoreProductController {
|
||||
@ForbidSubmit
|
||||
@Log("新增/修改商品")
|
||||
@ApiOperation(value = "新增/修改商品")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@PostMapping(value = "/yxStoreProduct/addOrSave")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody StoreProductDto storeProductDto){
|
||||
@@ -152,7 +152,7 @@ public class StoreProductController {
|
||||
@ForbidSubmit
|
||||
@Log("删除商品")
|
||||
@ApiOperation(value = "删除商品")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@DeleteMapping(value = "/yxStoreProduct/{id}")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
@@ -182,7 +182,7 @@ public class StoreProductController {
|
||||
|
||||
|
||||
@ApiOperation(value = "商品上架/下架")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@PostMapping(value = "/yxStoreProduct/onsale/{id}")
|
||||
public ResponseEntity onSale(@PathVariable Long id,@RequestBody String jsonStr){
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class SystemConfigController {
|
||||
@Log("新增或修改")
|
||||
@ApiOperation(value = "新增或修改")
|
||||
@PostMapping(value = "/yxSystemConfig")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")
|
||||
public ResponseEntity create(@RequestBody String jsonStr){
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SystemGroupDataController {
|
||||
@Log("新增数据配置")
|
||||
@ApiOperation(value = "新增数据配置")
|
||||
@PostMapping(value = "/yxSystemGroupData")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
|
||||
public ResponseEntity create(@RequestBody String jsonStr) {
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
@@ -98,7 +98,7 @@ public class SystemGroupDataController {
|
||||
@Log("修改数据配置")
|
||||
@ApiOperation(value = "修改数据配置")
|
||||
@PutMapping(value = "/yxSystemGroupData")
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY, allEntries = true)
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermissions('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
|
||||
public ResponseEntity update(@RequestBody String jsonStr) {
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
|
||||
@@ -68,7 +68,7 @@ public class YxWechatLiveController {
|
||||
return new ResponseEntity<>(yxWechatLiveService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@PostMapping
|
||||
@Log("新增wxlive")
|
||||
@@ -88,7 +88,7 @@ public class YxWechatLiveController {
|
||||
return new ResponseEntity<>(yxWechatLiveService.addGoods(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@PutMapping
|
||||
@Log("修改wxlive")
|
||||
@@ -99,7 +99,7 @@ public class YxWechatLiveController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除wxlive")
|
||||
@ApiOperation("删除wxlive")
|
||||
@@ -112,7 +112,7 @@ public class YxWechatLiveController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@CacheEvict(cacheNames = ShopConstants.ZSW_REDIS_INDEX_KEY,allEntries = true)
|
||||
|
||||
@ApiOperation("同步数据")
|
||||
@GetMapping("/synchro")
|
||||
public ResponseEntity<Object> synchroWxOlLive() {
|
||||
|
||||
Reference in New Issue
Block a user