import request from '@/config/axios'
export const searchQuestion = async (param) => {
  return await request.get({
    url: '/admin-api/applet/xunjia/question/list',
    params: param
  })
}

export const updateQuestion = async (data) => {
  return await request.put({
    url: '/admin-api/applet/xunjia/question/update',
    data: data
  })
}

export const addQuestion = async (data) => {
  return await request.post({
    url: '/admin-api/applet/xunjia/question/add',
    data: data
  })
}

export const deleteQuestion = async (id, source) => {
  return await request.delete({
    url: `/admin-api/applet/xunjia/question/delete?id=${id}&source=${source}`
  })
}

export const uploadFile = async (data) => {
  return await request.post({
    url: '/admin-api/applet/xunjia/question/upload',
    data: data
  })
}

export const getQuestionSort = async (param) => {
  return await request.get({
    url: '/admin-api/applet/xunjia/question/sort/list',
    params: param
  })
}

export const getMjList = async (params) => {
  return await request.get({
    url: 'http://localhost/tiku-api/tiku/xunjia/secret/list',
    params: params
  })
}

export const getDuplicateQuesionList = async (params) => {
  return await request.get({
    url: `admin-api/applet/xunjia/question/duplicate/list`,
    params
  })
}

export const deleteDuplicateQuestion = async (data) => {
  return await request.delete({
    url: `admin-api/applet/xunjia/question/duplicate/delete`,
    data
  })
}
