部分联系人信息和会话模块
This commit is contained in:
@@ -68,6 +68,8 @@ export function updateContact(id: string, data: {
|
||||
group_id?: number
|
||||
is_top?: boolean
|
||||
is_muted?: boolean
|
||||
is_special_care?: boolean
|
||||
is_blocked?: boolean
|
||||
}) {
|
||||
return request.post<Contact>(`/contacts/update/${id}`, data)
|
||||
}
|
||||
|
||||
37
src/api/modules/conversation.ts
Normal file
37
src/api/modules/conversation.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import request from '../request'
|
||||
import type { Conversation } from '@/types/conversation'
|
||||
|
||||
/**
|
||||
* 会话列表相关 API
|
||||
*/
|
||||
|
||||
// 获取会话列表
|
||||
export function getConversationList() {
|
||||
return request.get<Conversation[]>('/conversations')
|
||||
}
|
||||
|
||||
// 重置未读
|
||||
export function resetUnread(targetId: string) {
|
||||
return request.post<void>('/conversations/reset-unread', {
|
||||
target_id: targetId,
|
||||
})
|
||||
}
|
||||
|
||||
// 更新会话标记
|
||||
export function updateConversation(data: {
|
||||
target_id: string
|
||||
is_top?: boolean
|
||||
is_muted?: boolean
|
||||
is_special_care?: boolean
|
||||
}) {
|
||||
return request.post<void>('/conversations/update', data)
|
||||
}
|
||||
|
||||
// 删除会话
|
||||
export function deleteConversation(targetId: string) {
|
||||
return request.post<void>('/conversations/delete', {
|
||||
target_id: targetId,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user