ChatService

@Service
class ChatService(messageRepository: MessageRepository, contactRepository: ContactRepository, channelRepository: ChannelRepository, metaClient: MetaClient, storageService: StorageService, flowMessageService: FlowMessageService)(source)

Constructors

Link copied to clipboard
constructor(messageRepository: MessageRepository, contactRepository: ContactRepository, channelRepository: ChannelRepository, metaClient: MetaClient, storageService: StorageService, flowMessageService: FlowMessageService)

Functions

Link copied to clipboard
fun getHistory(tenantId: String, contactId: String, pageable: Pageable): Page<ChatMessageDTO>

Retorna o histórico de mensagens de um contato específico.

Link copied to clipboard
fun getInbox(tenantId: String, pageable: Pageable): Page<ChatInboxDTO>

Retorna a lista de conversas (Inbox) ordenadas por atividade recente.

Link copied to clipboard
@Transactional
fun markAsRead(tenantId: String, contactId: String)

Marca todas as mensagens de um contato como lidas.

Link copied to clipboard
@Transactional
fun sendMessage(tenantId: String, request: SendMessageRequest, file: MultipartFile?): Message