import request from '@/utils/request'
// 获取用户详细信息
export function getInfo() {
  return request({
    url: 'index/getInfo',
    method: 'get'
  })
}

//留言列表
export function leavewordList() {
  return request({
    url: '/online/message/leavelist',
    method: 'get'
  })
}
// 接入留言
export function leavewordDetail(openId) {
  return request({
    url: '/online/message/connect/' + openId,
    method: 'post'
  })
}
//会话列表
export function chatDialogueList(query) {
  return request({
    url: '/kefu/mongodbMessage',
    method: 'get',
    params: query
  })
}
//用户列表
export function chatUserList(query) {
  return request({
    url: '/online/link',
    method: 'get',
    params: query
  })
}
export function chatUserDetail(openId) {
  return request({
    url: '/system/customer/CodeInfo/'+openId,
    method: 'get'
  })
}
// 聊天详情
export function chatDetail(openId) {
  return request({
    url: '/online/message?khUser='+openId,
    method: 'get'
  })
}
// 聊天详情分页
export function chatDetailPage(getOpenId,query) {
  
  return request({
    url: '/online/history/'+getOpenId,
    method: 'get',
    params: query
  })
}
//客服签入
export function kefuLogin() {
  return request({
    url: '/system/user/kefuLogin',
    method: 'post'
  })
}
//客服签出
export function kefuLogout() {
  return request({
    url: '/system/user/kefuLogout',
    method: 'post'
  })
}
// 置忙
export function kefuBusy() {
  return request({
    url: '/online/message/status/1',
    method: 'post'
  })
}
// 置闲
export function kefuFree() {
  return request({
    url: '/online/message/status/0',
    method: 'post'
  })
}
//发送文件
export function sendFile(query) {
  return request({
    url: '/kefu/sendFile',
    method: 'post',
    params: query
  })
}
/////////////////////////////
// 个人库列表分类
// export function getkefumsgtemplate(query) {
//   return request({
//     url: '/wechat/kefuMessageGroup',
//     method: 'get',
//     params: query
//   })
// }
// //详情
// export function getkefumsgtemplateDetail(id) {
//   return request({
//     url: '/wechat/kefuMessageGroup/' + id,
//     method: 'get'
//   })
// }
// //新增
// export function getkefumsgtemplateAdd(params) {
//   return request({
//     url: '/wechat/kefuMessageGroup',
//     method: 'post',
//     data: params
//   })
// }
// //修改
// export function getkefumsgtemplateEdit(params) {
//   return request({
//     url: '/wechat/kefuMessageGroup',
//     method: 'put',
//     data: params
//   })
// }
// //删除
// export function getkefumsgtemplateDel(id) {
//   return request({
//     url: '/wechat/kefuMessageGroup/' + id,
//     method: 'delete'
//   })
// }
/////////////////////////////
//分组下面的模板
//子列表

/////////////////////////////
//右侧客户分组
export function getcustomertag(query) {
  return request({
    url: '/customer/customertag',
    method: 'get',
    params: query
  })
}
//获取在线客服
export function getonlineKefu(query) {
  return request({
    url: '/kefu/onlineKefu',
    method: 'get',
    params: query
  })
}
//转接
export function getonlinetransfer(params) {
  return request({
    url: '/kefu/transfer',
    method: 'post',
    params
  })
}

/**
 * 知识库
 * @constructor
 */

export function kefuRepositoryList(query) {
  return request({
    url: '/knowledge/details/kfKnowledge',
    method: 'get',
    params: query
  })
}

export function kefuMessageContentList(query) {
  return request({
    url: '/wechat/kefuMessageContent',
    method: 'get',
    params: query
  })
}
//新增
export function addKefuMessageContent(params) {
  return request({
    url: '/wechat/kefuMessageContent',
    method: 'post',
    data: params
  })
}
// //修改
export function editKefuMessageContent(params) {
  return request({
    url: '/wechat/kefuMessageContent',
    method: 'put',
    data: params
  })
}
// //删除
export function deleteKefumsgtemplateContent(id) {
  return request({
    url: '/wechat/kefuMessageContent/' + id,
    method: 'delete'
  })
}