/*
 * @Author: zc
 * @description 话务管理 - 上传录音
 */

import request from '@/utils/request';
import qs from 'qs';

/**
 * @description 获取录音列表
 * @param {object} params
 * @return {*}
 */
export const uploadRecordList = (params?: object) => {
	return request({
		url: '/api/v1/File/getaudiofileslist',
		method: 'get',
		params,
	});
};
/**
 * @description 导出录音列表
 * @param {object} data
 * @return {*}
 */
export const uploadRecordExport = (data: object) => {
	return request(
		{
			url: '/api/v1/File/getaudiofileslist/export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 保存录音
 * @param {object} data
 * @return {*}
 */
export const uploadRecordSave = (data: object) => {
	return request({
		url: '/api/v1/File/adduploadaudiofiles',
		method: 'post',
		data,
	});
};
/**
 * @description 删除录音
 * @param {object} params
 * @return {*}
 */
export const uploadRecordDelete = (params: object) => {
	return request({
		url: '/api/v1/File/deleteuploadaudiofiles',
		method: 'get',
		params,
		paramsSerializer: (params: any) => qs.stringify(params),
	});
};
