jinpengyong
2021-03-10 b1f6eded803531719005275065acc3f205b19298
screen-common/src/main/java/com/moral/redis/RedisUtil.java
@@ -2,6 +2,7 @@
import com.moral.util.SpringContextUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.CollectionUtils;
@@ -17,6 +18,7 @@
    private static RedisTemplate redisTemplate = SpringContextUtils.getBeanByName("redisTemplate");
    // =============================common============================
    /**
     * 设置过期时间内的key
     *
@@ -59,7 +61,7 @@
     * @author: wuqp
     * @date: 2021/02/24 9:46
     */
    public boolean hasKey(String key) {
    public static boolean hasKey(String key) {
        try {
            return redisTemplate.hasKey(key);
        } catch (Exception e) {
@@ -78,7 +80,7 @@
     * @date: 2021/02/24 9:46
     */
    @SuppressWarnings("unchecked")
    public void del(String... key) {
    public static void del(String... key) {
        if (key != null && key.length > 0) {
            if (key.length == 1) {
                redisTemplate.delete(key[0]);
@@ -89,6 +91,7 @@
    }
    // ============================String=============================
    /**
     * 获取string类型的缓存
     *