import { del, get, post, put } from '../../http'

/**
 * @description: 获取句子文件列表
 * @param {*} params
 * @return {*}
 */
export const getSentenceFileList = async (params: Record<string, any>) => {
  return await get<any>('/sentenceFile/list', params)
}

// 对话功能接口

/**
 * @description: 对话 根据文件id查询文件下的例句内容，默认只返回一百条 (音频剪辑编辑页面)
 * @param {*} id
 * @return {*}
 */
export const getdialogueDetailList = async (
  id: string,
  params: Record<string, any>,
) => {
  return await get<any>(`/sentenceFile/dialogueList/${id}`, params)
}

/**
 * @description: 例句人名表-查询列表
 * @param {*} id
 * @return {*}
 */
export const getSentencePersonName = async (params?: Record<string, any>) => {
  return await get<any>('/sentencePersonName/list', params)
}
/**
 * @description: 例句人名表-新增人名
 * @param {*} id
 * @return {*}
 */
export const addSentencePersonName = async (data?: Record<string, any>) => {
  return await post<any>('/sentencePersonName', data)
}

/**
 * @description: 例句人名表-删除人名
 * @param {*} id
 * @return {*}
 */
export const delSentencePersonName = async (id: string) => {
  return await del(`/sentencePersonName/${id}`)
}

/**
 * @description: 合并对话
 * @param {*} id
 * @return {*}
 */
export const mergeDialogueContentApi = async (data: Record<string, any>) => {
  return await post<any>('/sentenceFileContent/mergeDialogueContent', data)
}

/**
 * @description: 修改句子人名
 * @param {*} data
 * @return {*}
 */
export const putSentencePersonName = async (data: Record<string, any>) => {
  return await put('/sentenceFileContent/personName', data)
}

/**
 * @description: 例句对话表-查询列表
 * @param {*} id
 * @return {*}
 */
export const getsentenceDialogueList = async (params?: Record<string, any>) => {
  return await get<any>('/sentenceDialogue/list', params)
}

/**
 * @description: id查询-关联绑定词
 * @param {*} id
 * @return {*}
 */
export const getSentenceDialogueWithBindWord = async (
  id: string,
  params?: Record<string, any>,
) => {
  return await get<any>(`/sentenceDialogue/withBindWord/${id}`, params)
}

/**
 * @description: 例句对话表-更新对话主题
 * @param {*} id
 * @return {*}
 */
export const putSentenceDialogueTopic = async (data: Record<string, any>) => {
  return await put('/sentenceDialogue', data)
}
