lyfO_o
2022-07-04 73ad14eba38160802fd986252190fd8b823efc8d
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/redis/RedisUtils.java
@@ -12,6 +12,7 @@
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.HashSet;
@@ -37,6 +38,16 @@
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @PostConstruct
    public void initRepository(){
        try {
            this.set("test:module:Web", "testConnection", 60L, TimeUnit.SECONDS);
            logger.info("[ModuleRedis][Web] is connected");
        } catch (Exception e) {
            logger.error("[ModuleRedis][Web] connected failed!!");
        }
    }
    /**
     * 写入缓存
     * @param key