import request from '@/utils/request';
import { AgentQuery, AgentForm } from './types';

export function listAgent(query: AgentQuery) {
  return request({
    url: '/talk/admin/agent/list',
    method: 'get',
    params: query
  });
}

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

export function addAgent(data: AgentForm) {
  return request({
    url: '/talk/admin/agent',
    method: 'post',
    data: data
  });
}

export function updateAgent(data: AgentForm) {
  return request({
    url: '/talk/admin/agent',
    method: 'put',
    data: data
  });
}

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

export function getTtsVcnDict() {
  return request({
    url: '/talk/admin/agent/dict/ttsVcn',
    method: 'get'
  });
}

export function getLanguageDict() {
  return request({
    url: '/talk/admin/agent/dict/language',
    method: 'get'
  });
}
