import fetch from '@/utils/fetch'

/**
 * 【查】获取所有试卷分类
 * @returns [{}]
 */
export const findAllPaperClassifyApi = () =>
  fetch({ url: '/assessmentEvaluation/ExamPaperClassify', method: 'get' })

/**
 * 【增】新增试卷分类
 */
export const createPaperClassifyApi = (data) =>
  fetch({ url: '/assessmentEvaluation/ExamPaperClassify', method: 'post', data })

/**
 * 【删】删除试卷分类
 */
export const deletePaperClassifyApi = (id) =>
  fetch({ url: '/assessmentEvaluation/ExamPaperClassify/' + id, method: 'delete' })
/**
 * 【改】修改试卷分类
 */
export const editPaperClassifyApi = ({ id, ...data }) =>
  fetch({ url: '/assessmentEvaluation/ExamPaperClassify/' + id, method: 'patch', data })

/**
 * 【查】分页查询试卷
 * {currentPage,pageSize,classifyId,isPractive,title}
 */
export const pagingFindPaperApi = (params) =>
  fetch({ url: '/assessmentEvaluation/exampaper/paging', method: 'get', params })
/**
 * 【删】批量删除试卷
 */
export const deleteSomePapersApi = (data) =>
  fetch({ url: '/assessmentEvaluation/exampaper', method: 'delete', data })
/**
 * 【删】修改试卷信息
 */
export const patchPaperApi = ({ id, ...data }) =>
  fetch({ url: '/assessmentEvaluation/exampaper/item/' + id, method: 'patch', data })

/**
 * 【增】新增试卷
 * @param {object} data
 * @returns
 */
export const createPaperApi = (data) =>
  fetch({ url: '/assessmentEvaluation/exampaper', method: 'post', data })

/**
 * 【查】根据试卷ID查询试卷详情
 * @param {number|string} id
 * @returns
 */
export const getPaperInfoByIdApi = (id) =>
  fetch({ url: '/assessmentEvaluation/exampaper/item/' + id, method: 'get' })
  /**
   * 【改】根据试卷ID修改试卷
   * @param {object} param0 信息
   * @returns
   */
export const patchPaperInfoByIdApi = ({ id, ...data }) =>
  fetch({ url: '/assessmentEvaluation/exampaper/item/' + id, method: 'patch', data })
  /**
   * 【增】根据试卷ID复制试卷
   * @param {object} param0 信息
   * @returns
   */
export const copyPaperInfoByIdApi = ({ id, ...data }) =>
  fetch({ url: '/assessmentEvaluation/exampaper/copy/' + id, method: 'post', data })

/**
   *【改】批量移动试卷到分类
   * @param {Object{ids:[],classifyId:number}} data
   * @returns
   */
export const batchMovePaperClassify = (data) => fetch({ url: '/assessmentEvaluation/exampaper/putchAllClassifyId', method: 'patch', data })

/**
 * 【增】新增模拟试卷
 * @param {object} data
 * @returns
 */
export const createSimTestApi = (data) =>
  fetch({ url: '/assessmentEvaluation/simtest', method: 'post', data })

/**
 * 【查】分页查询试卷
 * {currentPage,pageSize,classifyId,isPractive,title}
 */
export const pagingFindSimPaperApi = (params) =>
  fetch({ url: '/assessmentEvaluation/simtest/paging', method: 'get', params })
/**
 * 【查】试卷被哪些考试引用
 */
export const checkQuoteApi = (id) =>
  fetch({ url: '/assessmentEvaluation/exampaper/checkQuote/' + id, method: 'get' })
