RedisUtilツールクラス
package com.amway.msgcenter.msgtask.util;
import org.springframework.beans.factory.annotation.Autowired;import org.springframework.dao.DataAccessException;import org.springframework.data.redis.connection.RedisConnection;import org.springframework.data.redis.core.RedisCallback;import org.springframework.data.redis.core.RedisTemplate;import org.springframework.data.redis.core.StringRedisTemplate;import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisCommands;
@Componentpublic class RedisUtil {
}
import org.springframework.beans.factory.annotation.Autowired;import org.springframework.dao.DataAccessException;import org.springframework.data.redis.connection.RedisConnection;import org.springframework.data.redis.core.RedisCallback;import org.springframework.data.redis.core.RedisTemplate;import org.springframework.data.redis.core.StringRedisTemplate;import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisCommands;
@Componentpublic class RedisUtil {
@Autowired
// template,StringRedisTemplate RedisTemplate
private StringRedisTemplate stringRedisTemplate;
@Autowired
// RedisTemplate,
private RedisTemplate
}