yupeng
2025-03-22 53c6ac64e4b17e92a7bd0b8a62b8296690fcd753
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -330,4 +330,14 @@
        Long result = (Long) redisTemplate.execute(UNLOCK_SCRIPT, Collections.singletonList(lockKeyWithPrefix), requestId);
        return result != null && result == 1L;
    }
    /**
     * 自增
     * @param key 要加一的键
     */
    public int increment(String key) {
        // +1 操作
        return redisTemplate.opsForValue().increment(key).intValue();
    }
}