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

/**
 * @description: 获取QA列表
 * @param {*} params
 * @return {*}
 */
const getQAList = async (params: Record<string, any>) => {
  return await get<any>('/smartConfig/list', { params })
}
/**
 * @description: 新增QA
 * @param {string} id
 */
const createQA = async (data: Record<string, any>) => {
  return await post<any>('/smartConfig', data)
}
/**
 * @description: 保存QA
 * @param {string} id
 */
const saveQA = async (data: Record<string, any>) => {
  return await put('/smartConfig', data)
}
/**
 * @description: 删除多QA
 * @param {string} data
 */
const deleteQA = async (data: string[]) => {
  return await post<any>('/smartConfig/ids', data)
}
/**
 * @description: 批量保存
 * @param {Record} data
 * @param {*} any
 */
const batchSaveQA = async (data: Record<string, any>) => {
  return await put('/smartConfig/editQAs', data)
}
/**
 * @description: 修改状态
 * @param {Record} data
 * @param {*} any
 */
const qaStatus = async (data: Record<string, any>) => {
  return await put('/smartConfig/updateStatus', data)
}

const qaManageApi = {
  getQAList,
  createQA,
  saveQA,
  deleteQA,
  batchSaveQA,
  qaStatus,
}

export default qaManageApi
