import request from '@/utils/request';
import { TalkUserQuery, TalkUserForm } from './types';

export function listTalkUser(query: TalkUserQuery) {
  return request({
    url: '/talk/admin/user/list',
    method: 'get',
    params: query
  });
}

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

export function addTalkUser(data: TalkUserForm) {
  return request({
    url: '/talk/admin/user',
    method: 'post',
    data: data
  });
}

export function updateTalkUser(data: TalkUserForm) {
  return request({
    url: '/talk/admin/user',
    method: 'put',
    data: data
  });
}

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

export function exportTalkUser(query: TalkUserQuery) {
  return request({
    url: '/talk/admin/user/export',
    method: 'post',
    data: query
  });
}
