//package com.hotent.portal.listener;
//
//import com.hotent.base.cache.annotation.CachePut;
//import com.hotent.base.cache.annotation.FirstCache;
//import com.hotent.base.constants.CacheKeyConst;
//import com.hotent.base.entity.URIEntity;
//import com.hotent.base.util.AppUtil;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.jms.annotation.JmsListener;
//import org.springframework.stereotype.Component;
//
//import java.util.HashSet;
//import java.util.Set;
//import java.util.concurrent.TimeUnit;
//
///**
// * @Author: Cola
// * @Date: 2021/08/24/10:19
// * @Description: 监听base模块下扫描出来的外部接口的
// **/
//
//@Component
//public class UriListener {
//    private Logger logger= LoggerFactory.getLogger(UriListener.class);
//
//    @Value("${openApi.prefix:'openApi'}")
//    private String PREFIX;
//    private Set<URIEntity> uriEntitySet=new HashSet<>();
//
//    @JmsListener(destination ="URI_QUEUE",containerFactory="jmsListenerContainerQueue")
//    public void receiveQueue(URIEntity entity) throws Exception {
//        // 替换前缀
//        entity.setClassURI(entity.getClassURI().replace("${openApi.prefix}",PREFIX).replace("//","/"));
//        UriListener bean = AppUtil.getBean(getClass());
//        uriEntitySet.add(entity);
//        bean.putCache("openApi",uriEntitySet);
//        logger.debug("[JMS]: queue message is :"+entity.getClass().getName()+"---"+entity);
//    }
//
//    @CachePut(value = CacheKeyConst.EIP_SYS_UC_OPEN_API,key = "#openApi",firstCache = @FirstCache(timeUnit = TimeUnit.DAYS,expireTime=3650))
//    public Set<URIEntity> putCache(String openApi,Set<URIEntity> set){
//        return set;
//    }
//
//}
