import fetch from '@/utils/fetch'

/**
 * -----------------------科目分类-----------------------
 * 【查】 - 获取所有科目分类
 */
export const getSubjectClassifyApi = (params) =>
  fetch({ url: '/train/subject/classify', method: 'get', params })

/**
 * 【查】 - 新增科目分类
 * @param {object} data
 */

export const createSubjectClassifyApi = (data) =>
  fetch({ url: '/train/subject/classify', method: 'post', data })

/**
 * 【改】 - 编辑科目分类
 * @param {object} data
 * @returns
 */
export const editorSubjectClassifyApi = (id, data) =>
  fetch({ url: '/train/subject/classify/' + id, method: 'patch', data })

/**
* 【删】 - 删除科目分类
* @param {object} data
* @returns
*/
export const deleteSubjectClassifyApi = (id) =>
  fetch({ url: '/train/subject/classify/' + id, method: 'delete' })

/**
 * -----------------------科目类型-----------------------
 * 【查】 - 查询科目所所有类型
 * @param {object} data
 */
export const getSubjectTypeApi = () =>
  fetch({ url: '/train/subject/traintype', method: 'get' })

/**
* 【查】 - 新增科目分类类型
* @param {object} data
*/

export const createSubjectTypefyApi = (data) =>
  fetch({ url: '/train/subject/traintype', method: 'post', data })

/**
* 【改】 - 编辑科目分类类型
* @param {object} data
* @returns
*/
export const editorSubjectTypeApi = (id, data) =>
  fetch({ url: '/train/subject/traintype/' + id, method: 'patch', data })

/**
* 【删】 - 删除科目分类类型
* @param {object} data
* @returns
*/
export const deleteSubjectTypeApi = (id) =>
  fetch({ url: '/train/subject/traintype/' + id, method: 'delete' })

/**
 * -----------------------科目-----------------------
 * 【查】 - 分页查询科目
 * @param {object} data
 */

export const pagingGetSubjectApi = (params) =>
  fetch({ url: '/train/subject/subject/paging', method: 'get', params })

/**
 * 【改】 - 修改科目状态
 * @param {object} data
 */

export const changeSubjectStatusApi = (data) =>
  fetch({ url: '/train/subject/subject/status', method: 'patch', data })

/**
 * 【查】 - 查询科目详情
 * @param {object} data
 */

export const getSubjectDetailsApi = (id) =>
  fetch({ url: '/train/subject/subject/details/' + id, method: 'get' })

/**
 * 【增】 - 增加科目
 * @param {object} data
 */

export const createSubjectApi = (data) =>
  fetch({ url: '/train/subject/subject', method: 'post', data })

/**
 * 【复制】 - 增加科目
 * @param {object} data
 */

export const copySubjectApi = (data) =>
  fetch({ url: '/train/subject/subject/copySubject', method: 'post', data })



/**
 * 【改】 - 编辑科目
 * @param {object} data
 */

export const editorSubjectApi = (id, data) =>
  fetch({ url: '/train/subject/subject/' + id, method: 'patch', data })

/**
* 【删】 - 删除科目
* @param {object} data
*/

export const deleteSubjectApi = (data) =>
  fetch({ url: '/train/subject/subject/all', method: 'delete', data })
