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

// 参数类型定义
interface CatchphraseListParams {
  keyword?: string
  page?: number
  size?: number
  status?: string
}

/**
 * @description: 获取名言列表
 */
export const getCatchphraseList = async (params: CatchphraseListParams) => {
  return await get<any>('/catchphrase/list', params)
}

/**
 * @description: 更新名言状态
 * @param {*} params
 * @return {*}
 */
export const updateCatchphrase = async (data: Record<string, any>) => {
  return await put('/catchphrase', data)
}

/**
 * @description: 新增名言
 * @param {*} params
 * @return {*}
 */
export const addCatchphrase = async (data: Record<string, any>) => {
  return await post<any>('/catchphrase', data)
}

/**
 * @description: 删除名言
 * @param {*} params
 * @return {*}
 */
export const deleteCatchphrase = async (id: string) => {
  return await del(`catchphrase/${id}`)
}
