public static void main(String[] args) {
Jedis jedis = new Jedis("127.0.0.1");//id自增
jedis.del("article:1:dianzan");
// System.out.println(incr);
for (int i = 0; i < 10; i++) {
Long incrid = jedis.incr("article:1:dianzan");
}
Long dianzanCounter = Long.valueOf(jedis.get("article:1:dianzan"));
System.out.println("博客点赞次数"+dianzanCounter);
//取消
jedis.decr("article:1:dianzan");//自动-1
Long dianzanCounter2 = Long.valueOf(jedis.get("article:1:dianzan"));
System.out.println("博客点赞次数"+dianzanCounter2);
}