package info.xiaomo.redis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 把今天最好的表现当作明天最新的起点．．～
 * いま 最高の表現 として 明日最新の始発．．～
 * Today the best performance  as tomorrow newest starter!
 * Created by IntelliJ IDEA.
 *
 * @author: xiaomo
 * @github: https://github.com/qq83387856
 * @email: hupengbest@163.com
 * @QQ_NO: 83387856
 * @Date: 2016/4/1 15:38
 * @Description: Redis启动器
 * @Copyright(©) 2015 by xiaomo.
 **/
@Configuration
@EnableAutoConfiguration
@ComponentScan("info.xiaomo")
@EnableCaching
@EnableScheduling
public class RedisMain {
    public static void main(String[] args) throws Exception {
        SpringApplication.run(RedisMain.class, args);
    }

    @Bean
    public CacheManager cacheManager(RedisTemplate redisTemplate) {
        return new RedisCacheManager(redisTemplate);
    }

//    @Bean
//    public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
//        final StringRedisTemplate template = new StringRedisTemplate(factory);
//        template.setValueSerializer(new Jackson2JsonRedisSerializer<>(Object.class)); //请注意这里
//        return template;
//    }

}

@@ -1350,323 +1350,6 @@
   %7D%0A
-%0A//    @Bean%0A//    public RedisTemplate%3CString, String%3E redisTemplate(RedisConnectionFactory factory) %7B%0A//        final StringRedisTemplate template = new StringRedisTemplate(factory);%0A//        template.setValueSerializer(new Jackson2JsonRedisSerializer%3C%3E(Object.class)); //%E8%AF%B7%E6%B3%A8%E6%84%8F%E8%BF%99%E9%87%8C%0A//        return template;%0A//    %7D%0A%0A
 %7D%0A

remove admin