mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
direct message
This commit is contained in:
@@ -41,24 +41,24 @@ export const MessageEntitySchema = z.object({
|
||||
|
||||
type Message = z.infer<typeof MessageEntitySchema>;
|
||||
|
||||
export class MessageEntity implements Message {
|
||||
export class MessageEntity {
|
||||
|
||||
$id: number
|
||||
id: string
|
||||
$id?: number
|
||||
id?: string
|
||||
roomId?: string
|
||||
receiverId?: number
|
||||
message: string
|
||||
message?: string
|
||||
messageType: number = 0
|
||||
canEdit: boolean = false
|
||||
oneShot: boolean = false
|
||||
sentAt: string
|
||||
sentAt?: string
|
||||
requireUnlock: boolean = false
|
||||
info: {
|
||||
memberId?: number
|
||||
readAt?: string,
|
||||
deliverAt?: string
|
||||
}[] = []
|
||||
sender: {
|
||||
sender!: {
|
||||
wxUserId: number,
|
||||
wxFullName: string,
|
||||
wxeMail: string,
|
||||
@@ -82,7 +82,7 @@ export class MessageEntity implements Message {
|
||||
|
||||
reactions = []
|
||||
|
||||
requestId: string
|
||||
requestId!: string
|
||||
|
||||
constructor() {}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { err, ok } from 'neverthrow';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { MessageLocalDataSourceService } from '../../data/repository/message/message-local-data-source.service';
|
||||
import { MessageSocketRepositoryService } from '../../data/repository/message/message-live-signalr-data-source.service';
|
||||
import { MessageRemoteDataSourceService } from '../../data/repository/message/message-remote-data-source.service';
|
||||
import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||
|
||||
@@ -11,7 +12,7 @@ import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||
export class MessageReadAtByIdUseCaseService {
|
||||
|
||||
constructor(
|
||||
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
||||
private MessageSocketRepositoryService: MessageSocketRepositoryService,
|
||||
private messageLiveSignalRDataSourceService: SignalRService,
|
||||
private messageLocalDataSourceService: MessageLocalDataSourceService,
|
||||
) { }
|
||||
@@ -21,7 +22,7 @@ export class MessageReadAtByIdUseCaseService {
|
||||
if(result.isOk()) {
|
||||
if(result.value) {
|
||||
|
||||
return await this.messageLiveSignalRDataSourceService.sendReadAt({roomId, memberId: SessionStore.user.UserId, chatMessageId: result.value.id})
|
||||
return await this.MessageSocketRepositoryService.sendReadAt({roomId, memberId: SessionStore.user.UserId, messageId: result.value.id, requestId: ''})
|
||||
}
|
||||
return ok(true)
|
||||
}
|
||||
|
||||
@@ -12,5 +12,8 @@ export class SocketJoinUseCaseService {
|
||||
) { }
|
||||
|
||||
|
||||
execute() {}
|
||||
execute() {
|
||||
|
||||
this.MessageSocketRepositoryService.sendDirectMessage
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user