微调
This commit is contained in:
@@ -1,67 +0,0 @@
|
|||||||
//package com.njcn.stat.listener;
|
|
||||||
//
|
|
||||||
//import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
//import com.njcn.common.pojo.exception.BusinessException;
|
|
||||||
//import com.njcn.redis.pojo.enums.AppRedisKey;
|
|
||||||
//import com.njcn.redis.utils.RedisUtil;
|
|
||||||
//import com.njcn.stat.enums.StatResponseEnum;
|
|
||||||
//import com.njcn.system.api.EpdFeignClient;
|
|
||||||
//import com.njcn.system.pojo.dto.EpdDTO;
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.apache.commons.lang3.StringUtils;
|
|
||||||
//import org.springframework.core.annotation.Order;
|
|
||||||
//import org.springframework.data.redis.connection.Message;
|
|
||||||
//import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
|
|
||||||
//import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
|
||||||
//import org.springframework.stereotype.Component;
|
|
||||||
//
|
|
||||||
//import javax.annotation.Resource;
|
|
||||||
//import java.util.HashMap;
|
|
||||||
//import java.util.List;
|
|
||||||
//import java.util.Map;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @author hongawen
|
|
||||||
// * @version 1.0.0
|
|
||||||
// * @date 2022年04月02日 14:31
|
|
||||||
// */
|
|
||||||
//@Slf4j
|
|
||||||
//@Component
|
|
||||||
//public class RedisKeyExpirationListener extends KeyExpirationEventMessageListener {
|
|
||||||
//
|
|
||||||
// @Resource
|
|
||||||
// private EpdFeignClient epdFeignClient;
|
|
||||||
//
|
|
||||||
// @Resource
|
|
||||||
// private RedisUtil redisUtil;
|
|
||||||
//
|
|
||||||
// public RedisKeyExpirationListener(RedisMessageListenerContainer listenerContainer) {
|
|
||||||
// super(listenerContainer);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 针对redis数据失效事件,进行数据处理
|
|
||||||
// * 注意message.toString()可以获取失效的key
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// @Order(0)
|
|
||||||
// public void onMessage(Message message, byte[] pattern) {
|
|
||||||
// if (StringUtils.isBlank(message.toString())) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// //判断失效的key
|
|
||||||
// String expiredKey = message.toString();
|
|
||||||
// if(expiredKey.equals(AppRedisKey.ELE_EPD_PQD)){
|
|
||||||
// Map<String,String> map = new HashMap<>();
|
|
||||||
// List<EpdDTO> list = epdFeignClient.findAll().getData();
|
|
||||||
// if (CollectionUtil.isEmpty(list)){
|
|
||||||
// throw new BusinessException(StatResponseEnum.DICT_NULL);
|
|
||||||
// }
|
|
||||||
// list.forEach(item->{
|
|
||||||
// map.put(item.getDictName(),item.getTableName());
|
|
||||||
// });
|
|
||||||
// redisUtil.saveByKeyWithExpire(AppRedisKey.ELE_EPD_PQD,map,3600L);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
Reference in New Issue
Block a user