web聊天室数据同步修改
This commit is contained in:
@@ -59,10 +59,12 @@ export const workcaseChatAPI = {
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页查询聊天室
|
||||
* 分页查询聊天室(含当前用户未读数)
|
||||
*/
|
||||
async getChatRoomPage(pageRequest: PageRequest<TbChatRoomDTO>): Promise<ResultDomain<ChatRoomVO>> {
|
||||
const response = await api.post<ChatRoomVO>(`${this.baseUrl}/room/page`, pageRequest)
|
||||
async getChatRoomPage(pageRequest: PageRequest<TbChatRoomDTO>, userId: string): Promise<ResultDomain<ChatRoomVO>> {
|
||||
const response = await api.post<ChatRoomVO>(`${this.baseUrl}/room/page`, pageRequest, {
|
||||
params: { userId }
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -92,6 +94,16 @@ export const workcaseChatAPI = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前用户在指定聊天室的未读消息数
|
||||
*/
|
||||
async getUnreadCount(roomId: string, userId: string): Promise<ResultDomain<number>> {
|
||||
const response = await api.get<number>(`${this.baseUrl}/room/${roomId}/unread`,
|
||||
{ userId }
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
// ====================== ChatRoom消息管理 ======================
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user