import client from './client'

export interface QueryRecordsParams {
  taskId?: string
  start?: string
  end?: string
  channelType?: string
  status?: number | string
  page?: number
  size?: number
}

export function queryRecords(params: QueryRecordsParams) {
  return client.get('/api/v1/send/records', { params })
}

export function getTaskStatus(taskId: string) {
  return client.get(`/api/v1/send/${taskId}/status`)
}

export function cancelTask(taskId: string) {
  return client.post(`/api/v1/send/${taskId}/cancel`)
}

export function testSend(data: any) {
  return client.post('/api/v1/send/test', data)
}

export function getStatistics(start: string, end: string) {
  return client.get('/api/v1/send/statistics', { params: { start, end } })
}
