import request from '@/utils/request'

export function getContacts(deviceId) {
  return request({
    url: '/qw/contact/list/'+deviceId,
    method: 'get'
  })
}


export function getContactsByUser(userId) {
  return request({
    url: '/qw/contact/listByUser/'+userId,
    method: 'get'
  })
}


export function getConversations(userId) {
  return request({
    url: '/qw/contact/conversationList/'+userId,
    method: 'get'
  })
}


export function getConversation(query) {
  return request({
    url: '/qw/contact/conversation',
    method: 'get',
    params:query
  })
}



export function getMessageList(query) {
  return request({
    url: '/qw/message/getList',
    method: 'get',
    params: query
  })
}


// 发送文本消息
export function sendTextMsg(data) {
  return request({
    url: '/qw/message/text',
    method: 'post',
    data: data
  })
}



// 发送文本消息
export function sendImageMsg(data) {
  return request({
    url: '/qw/message/image',
    method: 'post',
    data: data
  })
}


export function getRoomInfo(roomId) {
  return request({
    url: '/qw/room/roomDetail/'+roomId,
    method: 'get'
  })
}





