禁言
This commit is contained in:
@@ -133,3 +133,44 @@ export function getGroupNotifications(params?: {
|
||||
}>('/group-notifications', { params })
|
||||
}
|
||||
|
||||
// ========== 预留 API 接口(需后端支持) ==========
|
||||
|
||||
/**
|
||||
* 禁言成员
|
||||
* @param roomId 群ID
|
||||
* @param userId 用户ID
|
||||
* @param duration 禁言时长(秒),0 表示永久禁言,-1 表示解除禁言
|
||||
*/
|
||||
export function muteGroupMember(roomId: string, userId: string, duration: number) {
|
||||
return request.post<void>(`/groups/${roomId}/members/${userId}/mute`, { duration })
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新群设置(扩展版本,包含简介和邀请权限)
|
||||
* @param roomId 群ID
|
||||
* @param data 群设置数据
|
||||
*/
|
||||
export function updateGroupSettings(roomId: string, data: {
|
||||
name?: string
|
||||
avatar?: string
|
||||
description?: string // 群简介
|
||||
invite_permission?: number // 邀请权限:0-所有人 1-仅管理员 2-仅群主
|
||||
}) {
|
||||
return request.post<void>(`/groups/${roomId}/settings`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群设置
|
||||
* @param roomId 群ID
|
||||
*/
|
||||
export function getGroupSettings(roomId: string) {
|
||||
return request.get<{
|
||||
name: string
|
||||
avatar: string
|
||||
description: string
|
||||
invite_permission: number
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}>(`/groups/${roomId}/settings`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user