fix chat estracture

This commit is contained in:
Peter Maquiran
2024-07-25 08:51:04 +01:00
parent f4589aa96e
commit 9e6d7c2b4a
17 changed files with 132 additions and 65 deletions
@@ -75,6 +75,7 @@ export class MessageLocalDataSourceService {
async getLastMessageByRoomId(roomId: string): Promise<Result<undefined|TableMessage, any>> {
try {
console.log({roomId})
const lastMessage = await messageDataSource.message
.where('roomId')
.equals(roomId)
@@ -107,7 +108,7 @@ export class MessageLocalDataSourceService {
}
// @ValidateSchema(tableSchema)
// @ValidateSchema(tableSchema)
async createMessage(data: MessageInputDTO) {
try {
@@ -179,6 +179,10 @@ export class RoomLocalDataSourceService {
return await roomDataSource.room.toArray()
}
getMemberLive(data: {roomId, wxUserId}) {
const $roomIdUserId = data.roomId + data.wxUserId
return liveQuery(() => roomDataSource.memberList.get($roomIdUserId)) as any;
}
getItemsLive(): Observable<RoomListOutPutDTO[]> {
return liveQuery(() => roomDataSource.room.toArray()) as any;
@@ -11,8 +11,12 @@ export class UserTypingLiveDataSourceService {
private SignalRLiveDataSourceService: SignalRService
) { }
sendTyping(roomId) {
return this.SignalRLiveDataSourceService.sendTyping({roomId, UserName:SessionStore.user.FullName})
sendTyping(roomId, ) {
return this.SignalRLiveDataSourceService.sendTyping({
roomId,
UserName:SessionStore.user.FullName,
userId:SessionStore.user.UserId
})
}
}