@
feat(emergency): 新增腾讯IM验证的群成员列表接口,优化searchEmployee模糊搜索 - 新增 /order/getActualGroupMemberList 接口,先查本地参与人员再调腾讯IM验证,以交集为准 - 新增 GetGroupMemberInfoVO,封装腾讯IM get_group_member_info API响应 - TencentCloudImUtil 新增 getGroupMemberInfo 方法,TXController/IMHelloApi 新增对应端点 - GroupMemberVO 新增 isSelf 字段区分本人 (0/1),默认值 0 - searchEmployee 姓名/工号/手机号改为模糊搜索(* 包装实现) - 修复 getActualGroupMemberList IM 调用失败时静默返回空列表的 bug,失败时降级使用本地成员 - 接口文档更新变更摘要,标明新接口替换原 /order/getGroupMemberList 地址 Co-Authored-By: Claude <noreply@anthropic.com> @
This commit is contained in:
@@ -13,6 +13,7 @@ import com.renkang.im.util.IdWorker;
|
||||
import com.renkang.im.util.TencentCloudImUtil;
|
||||
import com.renkang.im.util.UniqId;
|
||||
import com.renkang.im.vo.AddGroupMemberVO;
|
||||
import com.renkang.im.vo.GetGroupMemberInfoVO;
|
||||
import com.renkang.im.vo.ImBaseResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -411,6 +412,12 @@ public class TXController {
|
||||
return Result.OK(tencentCloudImUtil.destroyGroup(groupId));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取群成员详细资料", description = "获取群成员详细资料")
|
||||
@GetMapping("/getGroupMemberInfo")
|
||||
public Result<GetGroupMemberInfoVO> getGroupMemberInfo(@RequestParam("groupId") String groupId) {
|
||||
return Result.OK(tencentCloudImUtil.getGroupMemberInfo(groupId));
|
||||
}
|
||||
|
||||
private String encodeChineseCharacters(String str) {
|
||||
return str.codePoints()
|
||||
.mapToObj(c -> {
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.renkang.im.dto.AddGroupMemberDTO;
|
||||
import com.renkang.im.dto.DeleteGroupMemberDTO;
|
||||
import com.renkang.im.entity.*;
|
||||
import com.renkang.im.vo.AddGroupMemberVO;
|
||||
import com.renkang.im.vo.GetGroupMemberInfoVO;
|
||||
import com.renkang.im.vo.ImBaseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
@@ -506,6 +507,30 @@ public class TencentCloudImUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取群成员详细资料
|
||||
*
|
||||
* @param groupId 群组ID
|
||||
* @return GetGroupMemberInfoVO
|
||||
*/
|
||||
public GetGroupMemberInfoVO getGroupMemberInfo(String groupId) {
|
||||
try {
|
||||
Integer random = RandomUtils.nextInt(0, 999999999);
|
||||
String httpsUrl = getHttpsUrl(TencentCloudImApiConstant.GroupManage.GET_GROUP_MEMBER_INFO, random);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("GroupId", groupId);
|
||||
log.info("腾讯云im【获取群成员详细资料】,请求参数:{}", jsonObject);
|
||||
String result = HttpUtil.doPost(httpsUrl, jsonObject);
|
||||
log.info("腾讯云im【获取群成员详细资料】,返回结果:{}", result);
|
||||
return JSONObject.toJavaObject(JSONObject.parseObject(result), GetGroupMemberInfoVO.class);
|
||||
} catch (Exception e) {
|
||||
log.error("【获取群成员详细资料】异常:{}", e.getMessage());
|
||||
GetGroupMemberInfoVO vo = new GetGroupMemberInfoVO();
|
||||
vo.setActionStatus("FAIL");
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除群成员
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user