import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AsrRecordVO, AsrRecordForm, AsrRecordQuery } from '@/api/ai/asrRecord/types';

/**
 * 查询AI语音识别记录列表
 * @param query
 * @returns {*}
 */

export const listAsrRecord = (query?: AsrRecordQuery): AxiosPromise<AsrRecordVO[]> => {
  return request({
    url: '/ai/asrRecord/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询AI语音识别记录详细
 * @param asrRecordId
 */
export const getAsrRecord = (asrRecordId: string | number): AxiosPromise<AsrRecordVO> => {
  return request({
    url: '/ai/asrRecord/' + asrRecordId,
    method: 'get'
  });
};

/**
 * 新增AI语音识别记录
 * @param data
 */
export const addAsrRecord = (data: AsrRecordForm) => {
  return request({
    url: '/ai/asrRecord',
    method: 'post',
    data: data
  });
};

/**
 * 修改AI语音识别记录
 * @param data
 */
export const updateAsrRecord = (data: AsrRecordForm) => {
  return request({
    url: '/ai/asrRecord',
    method: 'put',
    data: data
  });
};

/**
 * 删除AI语音识别记录
 * @param asrRecordId
 */
export const delAsrRecord = (asrRecordId: string | number | Array<string | number>) => {
  return request({
    url: '/ai/asrRecord/' + asrRecordId,
    method: 'delete'
  });
};


/**
 * 下拉框查询AI语音识别记录列表
 * @param query
 * @returns {*}
 */
export function getAiAsrRecordList (query) {
    return request({
        url: '/ai/asrRecord/getAiAsrRecordList',
        method: 'get',
        params: query
    });
};
