mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 07:01:37 +08:00
style: 优化全局代码格式
This commit is contained in:
@@ -62,8 +62,7 @@ public class BehaviorCaptchaAutoConfiguration {
|
||||
*/
|
||||
@Configuration
|
||||
@Import({BehaviorCaptchaCacheConfiguration.Redis.class, BehaviorCaptchaCacheConfiguration.Custom.class})
|
||||
protected static class BehaviorCaptchaCacheAutoConfiguration {
|
||||
}
|
||||
protected static class BehaviorCaptchaCacheAutoConfiguration {}
|
||||
|
||||
/**
|
||||
* 行为验证码服务接口
|
||||
@@ -94,8 +93,8 @@ public class BehaviorCaptchaAutoConfiguration {
|
||||
config.put(Const.CAPTCHA_FONT_SIZE, properties.getFontSize());
|
||||
config.put(Const.CAPTCHA_FONT_STYLE, properties.getFontStyle());
|
||||
config.put(Const.CAPTCHA_WORD_COUNT, 4);
|
||||
if (StrUtil.startWith(properties.getJigsawBaseMapPath(), "classpath:")
|
||||
|| StrUtil.startWith(properties.getPicClickBaseMapPath(), "classpath:")) {
|
||||
if (StrUtil.startWith(properties.getJigsawBaseMapPath(), "classpath:") || StrUtil.startWith(properties
|
||||
.getPicClickBaseMapPath(), "classpath:")) {
|
||||
// 自定义 resources 目录下初始化底图
|
||||
config.put(Const.CAPTCHA_INIT_ORIGINAL, true);
|
||||
initializeBaseMap(properties.getJigsawBaseMapPath(), properties.getPicClickBaseMapPath());
|
||||
@@ -110,9 +109,8 @@ public class BehaviorCaptchaAutoConfiguration {
|
||||
* @param picClick 点选验证码底图路径
|
||||
*/
|
||||
private static void initializeBaseMap(String jigsaw, String picClick) {
|
||||
ImageUtils.cacheBootImage(getResourcesImagesFile(jigsaw + "/original/*.png"),
|
||||
getResourcesImagesFile(jigsaw + "/slidingBlock/*.png"),
|
||||
getResourcesImagesFile(picClick + "/*.png"));
|
||||
ImageUtils
|
||||
.cacheBootImage(getResourcesImagesFile(jigsaw + "/original/*.png"), getResourcesImagesFile(jigsaw + "/slidingBlock/*.png"), getResourcesImagesFile(picClick + "/*.png"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -53,7 +53,8 @@ abstract class BehaviorCaptchaCacheConfiguration {
|
||||
@ConditionalOnProperty(name = PropertiesConstants.CAPTCHA_BEHAVIOR + ".cache-type", havingValue = "redis")
|
||||
static class Redis {
|
||||
static {
|
||||
CaptchaServiceFactory.cacheService.put(StorageType.REDIS.name().toLowerCase(), new BehaviorCaptchaCacheServiceImpl());
|
||||
CaptchaServiceFactory.cacheService.put(StorageType.REDIS.name()
|
||||
.toLowerCase(), new BehaviorCaptchaCacheServiceImpl());
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'Behavior-CaptchaCache-Redis' completed initialization.");
|
||||
}
|
||||
}
|
||||
@@ -72,7 +73,8 @@ abstract class BehaviorCaptchaCacheConfiguration {
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
CaptchaServiceFactory.cacheService.put(StorageType.CUSTOM.name().toLowerCase(), SpringUtil.getBean(CaptchaCacheService.class));
|
||||
CaptchaServiceFactory.cacheService.put(StorageType.CUSTOM.name().toLowerCase(), SpringUtil
|
||||
.getBean(CaptchaCacheService.class));
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'Behavior-CaptchaCache-Custom' completed initialization.");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user