com.xingyuv.captcha.config.AjCaptchaStorageAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-captcha-plus Show documentation
Show all versions of spring-boot-starter-captcha-plus Show documentation
spring-boot-starter-captcha-plus
package com.xingyuv.captcha.config;
import com.xingyuv.captcha.properties.AjCaptchaProperties;
import com.xingyuv.captcha.service.CaptchaCacheService;
import com.xingyuv.captcha.service.impl.CaptchaServiceFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 存储策略自动配置.
*/
@Configuration
public class AjCaptchaStorageAutoConfiguration {
@Bean(name = "AjCaptchaCacheService")
@ConditionalOnMissingBean
public CaptchaCacheService captchaCacheService(AjCaptchaProperties config){
//缓存类型redis/local/....
return CaptchaServiceFactory.getCache(config.getCacheType().name());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy