From 7a69bff0e065d603ed7fcde5efa72f67f624bbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=9C=AC=E4=BC=9F?= Date: Tue, 12 Apr 2022 10:21:18 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20Refactoring=20code.=20=20common-web?= =?UTF-8?q?socket=20=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8=20RedisMessageDis?= =?UTF-8?q?tributorConfig.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../websocket/config/LocalMessageDistributorConfig.java | 2 +- .../websocket/config/RedisMessageDistributorConfig.java | 2 +- .../pigx/admin/service/impl/SysFileServiceImpl.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/LocalMessageDistributorConfig.java b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/LocalMessageDistributorConfig.java index b0ce1d614..f76952ef8 100644 --- a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/LocalMessageDistributorConfig.java +++ b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/LocalMessageDistributorConfig.java @@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration; * @author hccake */ @ConditionalOnProperty(prefix = WebSocketProperties.PREFIX, name = "message-distributor", - havingValue = MessageDistributorTypeConstants.LOCAL, matchIfMissing = true) + havingValue = MessageDistributorTypeConstants.LOCAL) @Configuration(proxyBeanMethods = false) @RequiredArgsConstructor public class LocalMessageDistributorConfig { diff --git a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/RedisMessageDistributorConfig.java b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/RedisMessageDistributorConfig.java index 8cfca903d..a6263dd4f 100644 --- a/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/RedisMessageDistributorConfig.java +++ b/pigx-common/pigx-common-websocket/src/main/java/com/pig4cloud/pigx/common/websocket/config/RedisMessageDistributorConfig.java @@ -22,7 +22,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer; */ @ConditionalOnClass(StringRedisTemplate.class) @ConditionalOnProperty(prefix = WebSocketProperties.PREFIX, name = "message-distributor", - havingValue = MessageDistributorTypeConstants.REDIS) + havingValue = MessageDistributorTypeConstants.REDIS, matchIfMissing = true) @Configuration(proxyBeanMethods = false) @RequiredArgsConstructor public class RedisMessageDistributorConfig { diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java index db8407cb2..cd1af9ea8 100644 --- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java +++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java @@ -69,11 +69,11 @@ public class SysFileServiceImpl extends ServiceImpl impl resultMap.put("url", String.format("/admin/sys-file/%s/%s", ossProperties.getBucketName(), fileName)); try (InputStream inputStream = file.getInputStream()) { - minioTemplate.putObject(ossProperties.getBucketName(), fileName, inputStream, - file.getContentType()); + minioTemplate.putObject(ossProperties.getBucketName(), fileName, inputStream, file.getContentType()); // 文件管理数据记录,收集管理追踪文件 fileLog(file, fileName); - } catch (Exception e) { + } + catch (Exception e) { log.error("上传失败", e); return R.failed(e.getLocalizedMessage()); }