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/qwMsg/conversationList/'+userId,
    method: 'get'
  })
}


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



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

export function getQwUserList() {
  return request({
    url: '/qw/qwMsg/qwUserList',
    method: 'get',
  })
}




// 发送文本消息
export function sendMsg(data) {
  return request({
    url: '/qw/qwMsg/sendMsg',
    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'
  })
}



//导出消息
export function exportMessage(query) {
  return request({
    url: '/qw/message/export/',
    method: 'get',
    params: query
  })
}




