huminmin
4 小时以前 a53f698e4667bc57dcc1de65f77936024f9a06a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package cn.iocoder.yudao.module.im.service.friend;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.im.controller.admin.friend.vo.request.ImFriendRequestApplyReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo.ImFriendRequestManagerPageReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.friend.ImFriendRequestDO;
 
import java.util.List;
 
/**
 * IM 好友申请 Service 接口
 *
 * @author 芋道源码
 */
public interface ImFriendRequestService {
 
    /**
     * 发起好友申请
     *
     * @param fromUserId 发起方用户编号
     * @param reqVO      申请请求
     * @return 申请记录
     */
    ImFriendRequestDO applyFriend(Long fromUserId, ImFriendRequestApplyReqVO reqVO);
 
    /**
     * 同意好友申请
     *
     * @param userId    操作人用户编号
     * @param requestId 申请记录编号
     */
    void agreeFriendRequest(Long userId, Long requestId);
 
    /**
     * 拒绝好友申请
     *
     * @param userId        操作人用户编号
     * @param requestId     申请记录编号
     * @param handleContent 拒绝理由
     */
    void refuseFriendRequest(Long userId, Long requestId, String handleContent);
 
    /**
     * 查询「我相关」的申请列表(含我发起的、别人加我的);游标分页:传 maxId 拉更早一页
     *
     * @param userId 用户编号
     * @param maxId  当前列表最旧记录的 id;首页传 null
     * @param limit  单次拉取条数(page size,由前端常量控制)
     * @return 申请记录列表,按更新时间、id 倒序
     */
    List<ImFriendRequestDO> getMyFriendRequestList(Long userId, Long maxId, Integer limit);
 
    /**
     * 增量拉取「我相关」的好友申请(重连 / 离线补偿:双向 OR,按 update_time + id 游标)
     *
     * @param userId         用户编号
     * @param lastUpdateTime 上次拉取到的最新更新时间(毫秒时间戳);首次拉取传 null
     * @param lastId         上次拉取到的最后一条记录 id;首次拉取传 null
     * @param limit          单次拉取条数
     * @return 申请记录列表,按更新时间、id 正序
     */
    List<ImFriendRequestDO> pullFriendRequestList(Long userId, Long lastUpdateTime, Long lastId, Integer limit);
 
    /**
     * 按 id 单查申请记录;通用读接口,调用方自行做越权过滤
     */
    ImFriendRequestDO getFriendRequest(Long id);
 
    // ==================== 管理后台 ====================
 
    /**
     * 【管理后台】分页查询好友申请记录
     */
    PageResult<ImFriendRequestDO> getFriendRequestPage(ImFriendRequestManagerPageReqVO reqVO);
 
}