fix(IM): addGroupMember前先multiAccountImport,防止账号未注册导致添加失败
This commit is contained in:
@@ -520,6 +520,14 @@ public class TencentCloudImUtil {
|
|||||||
*/
|
*/
|
||||||
public AddGroupMemberVO addGroupMember(AddGroupMemberDTO dto) {
|
public AddGroupMemberVO addGroupMember(AddGroupMemberDTO dto) {
|
||||||
try {
|
try {
|
||||||
|
// 先导入账号,确保成员在IM系统中已注册
|
||||||
|
if (dto.getMemberList() != null && !dto.getMemberList().isEmpty()) {
|
||||||
|
List<String> memberAccounts = dto.getMemberList().stream()
|
||||||
|
.map(AddGroupMemberDTO.MemberListDTO::getMemberAccount)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
multiAccountImport(memberAccounts);
|
||||||
|
}
|
||||||
|
|
||||||
Integer random = RandomUtils.nextInt(0, 999999999);
|
Integer random = RandomUtils.nextInt(0, 999999999);
|
||||||
String httpsUrl = getHttpsUrl(TencentCloudImApiConstant.GroupManage.ADD_GROUP_MEMBER, random);
|
String httpsUrl = getHttpsUrl(TencentCloudImApiConstant.GroupManage.ADD_GROUP_MEMBER, random);
|
||||||
String jsonString = objectMapper.writeValueAsString(dto);
|
String jsonString = objectMapper.writeValueAsString(dto);
|
||||||
|
|||||||
Reference in New Issue
Block a user