From ca652464d9a815e683f2abbd554854de15e506a7 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 16:35:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=98=AF=E5=90=A6=E5=8F=91?= =?UTF-8?q?=E9=80=81=E4=BA=9A=E5=BE=AE=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysNoticeServiceImpl.java | 16 ++++++++++++---- renren-admin/src/main/resources/application.yml | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index 17ba31e3..7a7d3229 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -29,6 +29,7 @@ import org.apache.shiro.session.UnknownSessionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -65,6 +66,9 @@ public class SysNoticeServiceImpl extends CrudServiceImpl getWrapper(Map params) { QueryWrapper wrapper = new QueryWrapper<>(); @@ -212,10 +216,14 @@ public class SysNoticeServiceImpl extends CrudServiceImpl message = new MessageData().msg(notice.getTitle()); webSocketServer.sendMessage(finalUserIdList, message); }, executor).thenRunAsync(() -> { - try { - sendToYaweiUser(notice, finalUserIdList); - } catch (Exception exception) { - logger.error("", exception); + if (noticeYaWei) { + try { + sendToYaweiUser(notice, finalUserIdList); + } catch (Exception exception) { + logger.error("", exception); + } + } else { + logger.info("无需发送到第三方 亚微消息"); } }, executor); } diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 4381134f..be426500 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -152,4 +152,6 @@ front: # 基础设施,部门最大申请数量 infrastructure: dept-can-apply-max: 10 - +# 是否发亚微消息 +notice: + yawei: true