♻️ Refactoring code. common-websocket 默认使用 RedisMessageDistributorConfig.java

This commit is contained in:
卢本伟 committed 2022-04-12 10:21:18 +08:00
1 parent bfe8cc2336
commit 7a69bff0e0
3 files changed
+5 -5

No files matched your search

@@ -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 {
@@ -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 {
@@ -69,11 +69,11 @@ public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFile> 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());
}