import request from '../utils/request'

const api = {
  ConversationList: '/AIChat/Conversation/List',
  Conversation: '/AIChat/Conversation',
  MessageList: '/AIChat/Message/List',
  Message: '/AIChat/Message',
  AssistantDashboard: '/AIChat/Assistant/Dashboard',
  Quota: '/AIChat/Quota',
  WeixinBinding: '/AIChat/Weixin/Binding',
  AdminConversationList: '/Admin/AIChat/Conversation/List',
  AdminConversationDetail: '/Admin/AIChat/Conversation/Detail',
  AdminWeixinBindingList: '/Admin/AIChat/WeixinBinding/List'
}

export function listAIChatConversations(parameter) {
  return request({
    url: api.ConversationList,
    method: 'get',
    params: parameter
  })
}

export function deleteAIChatConversation(parameter) {
  return request({
    url: api.Conversation,
    method: 'delete',
    data: parameter
  })
}

export function listAIChatMessages(parameter) {
  return request({
    url: api.MessageList,
    method: 'get',
    params: parameter
  })
}

export function sendAIChatMessage(parameter) {
  return request({
    url: api.Message,
    method: 'post',
    data: parameter
  })
}

export function getAIChatAssistantDashboard(parameter) {
  return request({
    url: api.AssistantDashboard,
    method: 'get',
    params: parameter
  })
}

export function getAIChatQuota(parameter) {
  return request({
    url: api.Quota,
    method: 'get',
    params: parameter
  })
}

export function getWeixinBinding(parameter) {
  return request({
    url: api.WeixinBinding,
    method: 'get',
    params: parameter
  })
}

export function createWeixinBinding(parameter) {
  return request({
    url: api.WeixinBinding,
    method: 'post',
    data: parameter
  })
}

export function deleteWeixinBinding(parameter) {
  return request({
    url: api.WeixinBinding,
    method: 'delete',
    data: parameter
  })
}

export function adminListAIChatConversations(parameter) {
  return request({
    url: api.AdminConversationList,
    method: 'get',
    params: parameter
  })
}

export function adminGetAIChatConversationDetail(parameter) {
  return request({
    url: api.AdminConversationDetail,
    method: 'get',
    params: parameter
  })
}

export function adminListWeixinBindings(parameter) {
  return request({
    url: api.AdminWeixinBindingList,
    method: 'get',
    params: parameter
  })
}
