java中使用redis,实现key对应的value自增
/** * 实现某个key自增1,并且设置有效期 * @param key * @param liveTime * @return */public int increment(String key,long liveTime){ RedisAtomicInteger redisAtomicInteger = new RedisAtomicInteger(key, template.getConnectionFactory()); int andIncrement = redi.