From 3c64e82a5c6246b222e4e503d6ea3760aaf5e36a Mon Sep 17 00:00:00 2001 From: yanglin Date: Fri, 7 Feb 2025 09:36:43 +0800 Subject: [PATCH] =?UTF-8?q?REQ-3345:=20=E6=B7=BB=E5=8A=A0=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/axzo/im/group/GroupSupport.java | 7 +------ .../cn/axzo/im/service/ChatGroupService.java | 18 +++++++++++------- .../im/service/impl/ChatGroupServiceImpl.java | 9 +++++++++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/im-center-server/src/main/java/cn/axzo/im/group/GroupSupport.java b/im-center-server/src/main/java/cn/axzo/im/group/GroupSupport.java index 343b6cc..e9212c6 100644 --- a/im-center-server/src/main/java/cn/axzo/im/group/GroupSupport.java +++ b/im-center-server/src/main/java/cn/axzo/im/group/GroupSupport.java @@ -13,7 +13,6 @@ import cn.axzo.im.service.domain.ImAccounts; import cn.axzo.im.utils.BizAssertions; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.slf4j.helpers.MessageFormatter; import org.springframework.stereotype.Component; import java.util.Collections; @@ -102,11 +101,7 @@ public class GroupSupport implements GroupLogger { } public void log(String message, Object... args) { - try { - chatGroupService.sendDingRobot(MessageFormatter.arrayFormat(message, args).getMessage()); - } catch (Exception e) { - log.warn("发送钉钉机器人消息失败", e); - } + chatGroupService.log(message, args); } } \ No newline at end of file diff --git a/im-center-server/src/main/java/cn/axzo/im/service/ChatGroupService.java b/im-center-server/src/main/java/cn/axzo/im/service/ChatGroupService.java index 354cc44..119b641 100644 --- a/im-center-server/src/main/java/cn/axzo/im/service/ChatGroupService.java +++ b/im-center-server/src/main/java/cn/axzo/im/service/ChatGroupService.java @@ -18,6 +18,7 @@ import cn.axzo.im.center.api.vo.resp.HistoryMsgQueryResp; import cn.axzo.im.center.common.enums.ChatGroupUserDataSourceEnum; import cn.axzo.im.entity.ChatGroup; import cn.axzo.im.entity.dto.OrganizationalNodeUserDTO; +import cn.axzo.im.group.GroupLogger; import cn.hutool.core.lang.Pair; import com.baomidou.mybatisplus.extension.service.IService; @@ -29,7 +30,7 @@ import java.util.Set; * @date 2024/11/05 * @desc 群聊 */ -public interface ChatGroupService extends IService { +public interface ChatGroupService extends IService, GroupLogger { /** * 创建群聊 @@ -79,9 +80,10 @@ public interface ChatGroupService extends IService { /** * 拉人进群 - * @param tid 群Id - * @param owner 群主 - * @param members im账号集合 + * + * @param tid 群Id + * @param owner 群主 + * @param members im账号集合 * @param groupName 群名称 */ boolean userAddChatGroup(Long chatGroupId, String tid, String owner, Set members, String groupName, ChatGroupUserDataSourceEnum dataSource, Integer executeCount); @@ -93,15 +95,17 @@ public interface ChatGroupService extends IService { /** * 踢出群 - * @param tid 群Id - * @param owner 群主 + * + * @param tid 群Id + * @param owner 群主 * @param imAccount im账号 */ boolean kickChatGroup(Long chatGroupId, String tid, String owner, String imAccount); /** * 更改群主 - * @param chatGroupId 群聊Id + * + * @param chatGroupId 群聊Id * @param oldAccIdOwner 原群主账号 * @param newAccIdOwner 新群主账号 */ diff --git a/im-center-server/src/main/java/cn/axzo/im/service/impl/ChatGroupServiceImpl.java b/im-center-server/src/main/java/cn/axzo/im/service/impl/ChatGroupServiceImpl.java index 05a28da..beda881 100644 --- a/im-center-server/src/main/java/cn/axzo/im/service/impl/ChatGroupServiceImpl.java +++ b/im-center-server/src/main/java/cn/axzo/im/service/impl/ChatGroupServiceImpl.java @@ -77,6 +77,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.BooleanUtils; +import org.slf4j.helpers.MessageFormatter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; @@ -766,6 +767,14 @@ public class ChatGroupServiceImpl extends ServiceImpl