我正在尝试将@Configuration
public class RedisCacheConfig {
@Bean
StringRedisSerializer stringRedisSerializer() {
return new StringRedisSerializer();
}
@Bean
RedisConnectionFactory redisCacheConnectionFactory() {
RedisConnectionFactory redisCacheConnectionFactory = null;
// ... add your codes here
return redisCacheConnectionFactory;
}
@Bean
RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisCacheConnectionFactory) {
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(redisCacheConnectionFactory);
redisTemplate.setKeySerializer(this.stringRedisSerializer());
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
return redisTemplate;
}
@Bean(name = "stringRedisTemplate")
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisCacheConnectionFactory) throws UnknownHostException {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(redisCacheConnectionFactory);
stringRedisTemplate.setKeySerializer(this.stringRedisSerializer());
stringRedisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
return stringRedisTemplate;
}
@Bean
CacheManager cacheManager(RedisTemplate redisTemplate) {
RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
cacheManager.setDefaultExpiration(600l);
cacheManager.setUsePrefix(true);
return cacheManager;
}
}
与mapView
对齐,同时显示MKAnnotation
。但是,当我拨打MKAnnotationView
时,我的注释被驳回。我尝试了mapView.setCenter
和delay
但是没有用。任何帮助将不胜感激。谢谢!
mapView.selectAnnotation