|
@@ -105,19 +105,27 @@ public class HomePageDataInfoServiceImpl extends ServiceImpl<HomePageDataInfoMap
|
|
|
|
|
|
/**
|
|
|
* 删除首页数据(伪删除)
|
|
|
- * @param idTypes id-type
|
|
|
+ * @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
@SneakyThrows
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Response removeCarouselByIds(String[] idTypes) {
|
|
|
+ public Response removeCarouselByIds(Long[] ids) {
|
|
|
|
|
|
- for (String idType : idTypes) {
|
|
|
- String[] split = idType.split("-");
|
|
|
- this.update(new UpdateWrapper<HomePageDataInfo>().set("status","1").eq("id",split[0]));
|
|
|
- //删除缓存
|
|
|
- redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + split[1] + ":" + split[0]);
|
|
|
+ for (Long id : ids) {
|
|
|
+ this.update(new UpdateWrapper<HomePageDataInfo>().set("status","1").eq("id",id));
|
|
|
+
|
|
|
+ //判断类型 删除缓存
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.CAROUSElCHART.getDataType()+":"+id)){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.CAROUSElCHART.getDataType() + ":" + id);
|
|
|
+ }
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.COUPON.getDataType()+":"+id)){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.COUPON.getDataType() + ":" + id);
|
|
|
+ }
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.MENU.getDataType()+":"+id)){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.MENU.getDataType() + ":" + id);
|
|
|
+ }
|
|
|
}
|
|
|
return Response.success();
|
|
|
}
|