IM,群组相关页面

This commit is contained in:
2022-02-11 11:51:49 +08:00
parent b9364be40b
commit 8aebe0eef5
9 changed files with 279 additions and 28 deletions

View File

@@ -99,20 +99,68 @@ const getMyGroups = () => {
})
}
/**
* 获取群信息,包含基础信息和 14 个用户
*/
const getGroupInfo = (groupId) => {
return request({
url: 'im/groups/' + groupId
})
}
const getGroupUsers = (groupId) => {
return request({
url: 'im/groups/' + groupId + '/users'
})
}
const getGroupAnnouncements = (groupId) => {
return request({
url: 'im/groups/' + groupId + '/announcements'
})
}
/**
* 创建群聊
*/
const createGroup = (data) => {
return request({
method: 'POST',
url: 'im/groups',
data: data
})
}
const updateGroup = (groupId, data) => {
return request({
method: 'PUT',
url: 'im/groups/' + groupId,
data: data
})
}
/**
* 搜索群聊
*/
const searchGroup = (name) => {
return request({
url: 'im/groups/search?name=' + name
})
}
const joinGroup = (groupId) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/join'
})
}
const quitGroup = (groupId) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/quit'
})
}
export {
getImToken,
deleteFriend,
@@ -126,6 +174,12 @@ export {
searchFriend,
pedingFriend,
getMyGroups,
createGroup,
getGroupInfo
createGroup,
updateGroup,
getGroupInfo,
getGroupUsers,
getGroupAnnouncements,
searchGroup,
joinGroup,
quitGroup
}