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

/**
 * @description: 获取例句库列表
 * @param {*} params
 * @returns {*}
 */

export const getSentenceFileContentList = async (
  params: Record<string, any>,
) => {
  return await get<any>('/sentenceFileContent/pageList', params)
}

/**
 * @description: 获取例句库详情
 * @param {*} params
 * @returns {*}
 */

export const getSentenceFileContentFromId = async (
  id: string,
  params?: Record<string, any>,
) => {
  return await get<any>(`/sentenceFileContent/${id}`, params)
}

/**
 * @description: 新增例句中的释义
 * @param {*} params
 * @returns {*}
 */

export const addSentenceFileContentWordMeaning = async (
  data: Record<string, any>,
) => {
  return await post<any>('/sentenceFileContentWord', data)
}

/**
 * @description: 更新例句中的释义
 * @param {*} params
 * @returns {*}
 */

export const updateSentenceFileContentWordMeaning = async (
  data: Record<string, any>,
) => {
  return await put('/sentenceFileContentWord', data)
}

/**
 * @description: 删除例句中的释义
 * @param {*} params
 * @returns {*}
 */

export const delSentenceFileContentWordMeaning = async (data: string) => {
  return await del(`/sentenceFileContentWord/${data}`)
}

/**
 * @description: 删除例句中的释义
 * @param {*} params
 * @returns {*}
 */

export const getMeaningListBySpellSentence = async (spell: string) => {
  return await get<any>(
    `sentenceFileContentWord/getMeaningListBySpell/${spell}`,
  )
}
