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

/**
 * @description: 新增读物句子
 * @param {*} params
 * @returns {*}
 */
export const createBookContentSentence = async (data: Record<string, any>) => {
  return await post<any>('/bookContentSentence', data)
}

/**
 * @description: 更新读物句子
 * @param {*} params
 * @returns {*}
 */
export const updateBookContentSentence = async (data: Record<string, any>) => {
  return await put('/bookContentSentence', data)
}

/**
 * @description: 删除读物句子
 * @param {*} params
 * @returns {*}
 */
export const deleteBookContentSentence = async (id: string) => {
  return await del(`/bookContentSentence/${id}`)
}

/**
 * @description: 移动句子
 * @param {*} params
 * @returns {*}
 */
export const handleSwapSentences = async (data: Record<string, any>) => {
  return await post<any>('/bookContentSentence/swapSentences', data)
}

/**
 * @description: 添加核心词释义
 * @param {*} data
 * @returns {*}
 */
export const handleAddMeaning = async (data: Record<string, any>) => {
  return await post<any>('/book/censorCoreWord', data)
}

/**
 * @description: 修改核心词释义
 * @param {*} data
 * @returns {*}
 */
export const handlePutMeaning = async (data: Record<string, any>) => {
  return await put('/bookCoreWordCensorRecord', data)
}
