style: 优化全局代码格式

This commit is contained in:
2024-01-10 21:24:02 +08:00
parent ab19c05f00
commit 57c21a9109
51 changed files with 627 additions and 186 deletions

View File

@@ -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"));
}
/**

View File

@@ -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.");
}
}

View File

@@ -54,8 +54,7 @@ public enum GraphicCaptchaType {
/**
* 特殊类型
*/
SPEC(SpecCaptcha.class),
;
SPEC(SpecCaptcha.class),;
/**
* 验证码实现