feat(im): 添加即时通讯SDK核心功能
- 实现IM API接口定义,包括消息、群组、好友、黑名单等功能 - 定义IM消息相关数据模型,包含聊天类型、消息类型、用户资料等 - 实现ImSDK单例类,提供登录、消息发送、群组管理、好友管理等核心功能 - 添加WebSocket连接管理,支持自动重连机制 - 实现历史消息查询、群组操作、用户资料管理等API调用 - 添加会话状态管理,支持置顶、静音、草稿等功能 - 集成文件上传结果,支持多媒体消息发送 - 实现连接状态监听和事件回调机制
这个提交包含在:
父节点
110f5f3421
当前提交
d3eb86ae8c
@ -112,6 +112,29 @@ export function listGroups(): Promise<ImGroup[]> {
|
||||
return http.get<ImGroup[]>('/api/im/groups', appQuery())
|
||||
}
|
||||
|
||||
export function searchUsers(keyword: string, size = 20): Promise<UserProfile[]> {
|
||||
return http.get<UserProfile[]>('/api/im/admin/users/search', appQuery({ keyword, size }))
|
||||
}
|
||||
|
||||
export function searchGroups(keyword: string, size = 20): Promise<ImGroup[]> {
|
||||
return http.get<ImGroup[]>('/api/im/admin/groups/search', appQuery({ keyword, size }))
|
||||
}
|
||||
|
||||
export function searchMessages(
|
||||
keyword: string | null = null,
|
||||
chatType: ChatType | null = null,
|
||||
msgType: string | null = null,
|
||||
startTime: string | number | Date | null = null,
|
||||
endTime: string | number | Date | null = null,
|
||||
page = 0,
|
||||
size = 20,
|
||||
): Promise<PageResult<ImMessage>> {
|
||||
return http.get<PageResult<ImMessage>>(
|
||||
'/api/im/admin/messages/search',
|
||||
appQuery({ keyword, chatType, msgType, startTime, endTime, page, size }),
|
||||
)
|
||||
}
|
||||
|
||||
export function getGroupInfo(groupId: string): Promise<ImGroup> {
|
||||
return http.get<ImGroup>(`/api/im/groups/${encodeURIComponent(groupId)}`, appQuery())
|
||||
}
|
||||
|
||||
@ -15,6 +15,9 @@ export {
|
||||
listConversations,
|
||||
markRead,
|
||||
getProfile,
|
||||
searchGroups,
|
||||
searchMessages,
|
||||
searchUsers,
|
||||
rejectFriendRequest,
|
||||
rejectGroupJoinRequest,
|
||||
sendFriendRequest,
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户