import request from '@/utils/request';
import { WhatsAppHistoryQuery } from './types';

export function listWhatsAppHistory(query: WhatsAppHistoryQuery) {
  return request({
    url: '/talk/admin/whatsapp/history/list',
    method: 'get',
    params: query
  });
}

export function getWhatsAppHistory(id: string | number) {
  return request({
    url: '/talk/admin/whatsapp/history/' + id,
    method: 'get'
  });
}

export function delWhatsAppHistory(id: string | number | Array<string | number>) {
  return request({
    url: '/talk/admin/whatsapp/history/' + id,
    method: 'delete'
  });
}

export function exportWhatsAppHistory(query: WhatsAppHistoryQuery) {
  return request({
    url: '/talk/admin/whatsapp/history/export',
    method: 'post',
    data: query
  });
}
