公告,群资料

This commit is contained in:
2022-02-14 13:36:33 +08:00
parent de7f0453bb
commit d8c1ab7090
4 changed files with 163 additions and 83 deletions

View File

@@ -107,15 +107,15 @@ const getGroupInfo = (groupId) => {
url: 'im/groups/' + groupId
})
}
/**
* 群组基础信息
*/
/**
* 群组基础信息
*/
const getGroupBase = (groupId) => {
return request({
url: 'im/groups/' + groupId+ '/base'
url: 'im/groups/' + groupId + '/base'
})
}
}
const getGroupUsers = (groupId) => {
return request({
@@ -127,24 +127,24 @@ const getGroupAnnouncements = (groupId) => {
return request({
url: 'im/groups/' + groupId + '/announcements'
})
}
const createGroupAnnouncement = (groupId, content) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/announcements',
data: {
content: content
}
})
}
const deleteGroupAnnouncement = (groupId, announcementId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId + '/announcements/' + announcementId
})
}
}
const createGroupAnnouncement = (groupId, content) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/announcements',
data: {
content: content
}
})
}
const deleteGroupAnnouncement = (groupId, announcementId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId + '/announcements/' + announcementId
})
}
/**
* 创建群聊
@@ -155,14 +155,14 @@ const createGroup = (data) => {
url: 'im/groups',
data: data
})
}
const updateGroup = (groupId, data) => {
return request({
method: 'PUT',
url: 'im/groups/' + groupId,
data: data
})
}
const updateGroup = (groupId, data) => {
return request({
method: 'PUT',
url: 'im/groups/' + groupId,
data: data
})
}
/**
@@ -179,14 +179,24 @@ const joinGroup = (groupId) => {
method: 'POST',
url: 'im/groups/' + groupId + '/join'
})
}
}
const quitGroup = (groupId) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/quit'
})
}
}
/**
* 解散群聊
*/
const dismissGroup = (groupId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId
})
}
export {
getImToken,
@@ -201,15 +211,16 @@ export {
searchFriend,
pedingFriend,
getMyGroups,
createGroup,
createGroup,
updateGroup,
getGroupInfo,
getGroupInfo,
getGroupBase,
getGroupUsers,
getGroupAnnouncements,
createGroupAnnouncement,
getGroupUsers,
getGroupAnnouncements,
createGroupAnnouncement,
deleteGroupAnnouncement,
searchGroup,
joinGroup,
quitGroup
joinGroup,
quitGroup,
dismissGroup
}