Добавлены новые зависимости для работы с эмодзи и улучшена структура базы данных. Реализована модель сообщений и обновлены компоненты для поддержки новых функций мессенджера. Обновлены запросы и мутации для работы с сообщениями и чатом.
This commit is contained in:
@ -355,4 +355,195 @@ export const REMOVE_COUNTERPARTY = gql`
|
||||
mutation RemoveCounterparty($organizationId: ID!) {
|
||||
removeCounterparty(organizationId: $organizationId)
|
||||
}
|
||||
`
|
||||
|
||||
// Мутации для сообщений
|
||||
export const SEND_MESSAGE = gql`
|
||||
mutation SendMessage($receiverOrganizationId: ID!, $content: String!, $type: MessageType = TEXT) {
|
||||
sendMessage(receiverOrganizationId: $receiverOrganizationId, content: $content, type: $type) {
|
||||
success
|
||||
message
|
||||
messageData {
|
||||
id
|
||||
content
|
||||
type
|
||||
voiceUrl
|
||||
voiceDuration
|
||||
fileUrl
|
||||
fileName
|
||||
fileSize
|
||||
fileType
|
||||
senderId
|
||||
senderOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
receiverOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
isRead
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const SEND_VOICE_MESSAGE = gql`
|
||||
mutation SendVoiceMessage($receiverOrganizationId: ID!, $voiceUrl: String!, $voiceDuration: Int!) {
|
||||
sendVoiceMessage(receiverOrganizationId: $receiverOrganizationId, voiceUrl: $voiceUrl, voiceDuration: $voiceDuration) {
|
||||
success
|
||||
message
|
||||
messageData {
|
||||
id
|
||||
content
|
||||
type
|
||||
voiceUrl
|
||||
voiceDuration
|
||||
fileUrl
|
||||
fileName
|
||||
fileSize
|
||||
fileType
|
||||
senderId
|
||||
senderOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
receiverOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
isRead
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const SEND_IMAGE_MESSAGE = gql`
|
||||
mutation SendImageMessage($receiverOrganizationId: ID!, $fileUrl: String!, $fileName: String!, $fileSize: Int!, $fileType: String!) {
|
||||
sendImageMessage(receiverOrganizationId: $receiverOrganizationId, fileUrl: $fileUrl, fileName: $fileName, fileSize: $fileSize, fileType: $fileType) {
|
||||
success
|
||||
message
|
||||
messageData {
|
||||
id
|
||||
content
|
||||
type
|
||||
voiceUrl
|
||||
voiceDuration
|
||||
fileUrl
|
||||
fileName
|
||||
fileSize
|
||||
fileType
|
||||
senderId
|
||||
senderOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
receiverOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
isRead
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const SEND_FILE_MESSAGE = gql`
|
||||
mutation SendFileMessage($receiverOrganizationId: ID!, $fileUrl: String!, $fileName: String!, $fileSize: Int!, $fileType: String!) {
|
||||
sendFileMessage(receiverOrganizationId: $receiverOrganizationId, fileUrl: $fileUrl, fileName: $fileName, fileSize: $fileSize, fileType: $fileType) {
|
||||
success
|
||||
message
|
||||
messageData {
|
||||
id
|
||||
content
|
||||
type
|
||||
voiceUrl
|
||||
voiceDuration
|
||||
fileUrl
|
||||
fileName
|
||||
fileSize
|
||||
fileType
|
||||
senderId
|
||||
senderOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
receiverOrganization {
|
||||
id
|
||||
name
|
||||
fullName
|
||||
type
|
||||
users {
|
||||
id
|
||||
avatar
|
||||
managerName
|
||||
}
|
||||
}
|
||||
isRead
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const MARK_MESSAGES_AS_READ = gql`
|
||||
mutation MarkMessagesAsRead($conversationId: ID!) {
|
||||
markMessagesAsRead(conversationId: $conversationId)
|
||||
}
|
||||
`
|
Reference in New Issue
Block a user