From a0bed51d966ab5d161d3fdd5423ba84f59fb60ff Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期四, 13 一月 2022 09:58:16 +0800 Subject: [PATCH] update 格式化代码 统一间隔符 --- ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java | 68 +++++++++++++++++----------------- 1 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java index 9a421c1..3652f64 100644 --- a/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java +++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/factory/OssFactory.java @@ -23,10 +23,10 @@ @Slf4j public class OssFactory { - /** - * 鏈嶅姟瀹炰緥缂撳瓨 - */ - private static final Map<String, IOssStrategy> SERVICES = new ConcurrentHashMap<>(); + /** + * 鏈嶅姟瀹炰緥缂撳瓨 + */ + private static final Map<String, IOssStrategy> SERVICES = new ConcurrentHashMap<>(); /** * 鍒濆鍖栧伐鍘� @@ -42,40 +42,40 @@ }); } - /** - * 鑾峰彇榛樿瀹炰緥 - */ - public static IOssStrategy instance() { - // 鑾峰彇redis 榛樿绫诲瀷 - String type = RedisUtils.getCacheObject(OssConstant.CACHE_CONFIG_KEY); - if (StringUtils.isEmpty(type)) { - throw new OssException("鏂囦欢瀛樺偍鏈嶅姟绫诲瀷鏃犳硶鎵惧埌!"); - } - return instance(type); - } + /** + * 鑾峰彇榛樿瀹炰緥 + */ + public static IOssStrategy instance() { + // 鑾峰彇redis 榛樿绫诲瀷 + String type = RedisUtils.getCacheObject(OssConstant.CACHE_CONFIG_KEY); + if (StringUtils.isEmpty(type)) { + throw new OssException("鏂囦欢瀛樺偍鏈嶅姟绫诲瀷鏃犳硶鎵惧埌!"); + } + return instance(type); + } - /** - * 鏍规嵁绫诲瀷鑾峰彇瀹炰緥 - */ - public static IOssStrategy instance(String type) { + /** + * 鏍规嵁绫诲瀷鑾峰彇瀹炰緥 + */ + public static IOssStrategy instance(String type) { IOssStrategy service = SERVICES.get(type); - if (service == null) { - refreshService(type); - service = SERVICES.get(type); - } - return service; - } + if (service == null) { + refreshService(type); + service = SERVICES.get(type); + } + return service; + } - private static void refreshService(String type) { - Object json = RedisUtils.getCacheObject(OssConstant.SYS_OSS_KEY + type); + private static void refreshService(String type) { + Object json = RedisUtils.getCacheObject(OssConstant.SYS_OSS_KEY + type); OssProperties properties = JsonUtils.parseObject(json.toString(), OssProperties.class); - if (properties == null) { - throw new OssException("绯荤粺寮傚父, '" + type + "'閰嶇疆淇℃伅涓嶅瓨鍦�!"); - } - // 鑾峰彇redis閰嶇疆淇℃伅 鍒涘缓瀵硅薄 骞剁紦瀛� + if (properties == null) { + throw new OssException("绯荤粺寮傚父, '" + type + "'閰嶇疆淇℃伅涓嶅瓨鍦�!"); + } + // 鑾峰彇redis閰嶇疆淇℃伅 鍒涘缓瀵硅薄 骞剁紦瀛� IOssStrategy service = (IOssStrategy) ReflectUtils.newInstance(OssEnumd.getServiceClass(type)); - ((AbstractOssStrategy)service).init(properties); - SERVICES.put(type, service); - } + ((AbstractOssStrategy)service).init(properties); + SERVICES.put(type, service); + } } -- Gitblit v1.9.3