Commit 5b9c4182 by Future

sdk添加待处理好友列表获取

parent 129d6577
package com.wecloud.im.friend.controller;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.friend.param.ImCreateRecommendParam;
import com.wecloud.im.friend.param.ImDeleteFriendParam;
import com.wecloud.im.friend.param.ImDeleteRecommendParam;
import com.wecloud.im.friend.param.ImFriendApplyDto;
import com.wecloud.im.friend.param.ImFriendApplyParam;
import com.wecloud.im.friend.param.ImFriendApproveParam;
import com.wecloud.im.friend.param.ImFriendBaseDto;
import com.wecloud.im.friend.param.ImFriendBaseParam;
import com.wecloud.im.friend.param.ImFriendPageParam;
import com.wecloud.im.friend.param.ImFriendRecommendDto;
import com.wecloud.im.friend.service.ImFriendService;
import com.wecloud.im.sdk.enums.FriendStateEnum;
import com.wecloud.im.service.ImClientService;
import io.geekidea.springbootplus.framework.common.api.ApiCode;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
......@@ -7,33 +21,20 @@ import io.geekidea.springbootplus.framework.common.enums.BaseEnum;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.util.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.friend.param.ImCreateRecommendParam;
import com.wecloud.im.friend.param.ImDeleteFriendParam;
import com.wecloud.im.friend.param.ImDeleteRecommendParam;
import com.wecloud.im.friend.param.ImFriendApplyDto;
import com.wecloud.im.friend.param.ImFriendApplyParam;
import com.wecloud.im.friend.param.ImFriendApproveParam;
import com.wecloud.im.friend.param.ImFriendBaseDto;
import com.wecloud.im.friend.param.ImFriendBaseParam;
import com.wecloud.im.friend.param.ImFriendPageParam;
import com.wecloud.im.friend.param.ImFriendRecommendDto;
import com.wecloud.im.friend.service.ImFriendService;
import com.wecloud.im.sdk.enums.FriendStateEnum;
import com.wecloud.im.service.ImClientService;
import java.util.List;
/**
* @author lixiaozhong
......@@ -111,6 +112,19 @@ public class ImFriendController extends BaseController {
}
/**
* 好友请求列表,最多只返回1000个 sdk使用
*/
@GetMapping("/sdk/unsureFriends")
@ApiOperation(value = "获取好友请求列表,最多只返回1000个")
public ApiResult<List<ImFriendApplyDto>> getUnsureFriendsSdk(@RequestParam("clientId") String clientId) {
Long appId = SecurityUtils.getCurrentAppId();
ImClient imClient = imClientService.getCacheImClient(appId, clientId);
List<ImFriendApplyDto> applyFriends = imFriendService.getApplyFriends(imClient);
return ApiResult.ok(applyFriends);
}
/**
* 接受/拒绝好友申请
*/
@PostMapping("/approve")
......
......@@ -153,7 +153,7 @@ public class ChannelSender {
// 根据provider的ip,port创建Address实例
for(ClientChannelInfo clientChannelInfo : channelInfoEntry.getValue()) {
// dubbo指定ip调用
Address address = new Address(clientChannelInfo.getLanIp(), 20881);
Address address = new Address(clientChannelInfo.getLanIp(), 20882);
RpcContext.getContext().setObjectAttachment("address", address);
log.info("dubbo指定ip调用 {}", JSON.toJSONString(address));
routerSendService.sendMsgRemote(toClientId, clientChannelInfo.getPlatform(), msgJson);
......
......@@ -29,7 +29,7 @@ public class ResourcePathConstants {
/**
* 获取好友申请列表
*/
public static final String GET_UNSURE_FRIENDS = "/api/friends/sdk/unsureFriends";
public static final String GET_UNSURE_FRIENDS = "/api/friend/sdk/unsureFriends";
/**
* 全量获取好友列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment