All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spring.turbo.module.misc.autoconfiguration.CaptchaSupportRedisAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 3.3.3
Show newest version
package spring.turbo.module.misc.autoconfiguration;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.StringRedisTemplate;
import spring.turbo.module.misc.captcha.support.CaptchaDao;
import spring.turbo.module.misc.captcha.support.RedisCaptchaDao;

/**
 * @author 应卓
 * @since 1.3.0
 */
@AutoConfiguration
@ConditionalOnMissingBean(CaptchaDao.class)
@ConditionalOnBean(type = "org.springframework.data.redis.core.StringRedisTemplate")
public class CaptchaSupportRedisAutoConfiguration {

    @Bean
    public CaptchaDao captchaDao(StringRedisTemplate template) {
        return new RedisCaptchaDao(template);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy