web聊天室数据同步修改

This commit is contained in:
2025-12-24 15:02:23 +08:00
parent 1fd26dcf1a
commit 898da3a2c6
16 changed files with 691 additions and 53 deletions

View File

@@ -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消息管理 ======================
/**