import Axios from '@/utils/request'

// 获取培训列表
export function queryTrainPlanPage (params) {
  return Axios({
    url: '/app/train/queryTrainPlanPage',
    method: 'get',
    params
  })
}

// 获取课程列表
export function queryCourseByTrainingPlanId (params) {
  return Axios({
    url: '/app/train/queryCourseByTrainingPlanId',
    method: 'get',
    params
  })
}
// 试题列表
export function queryQuestionBankByTrainingPlanId (params) {
  return Axios({
    url: '/app/train/queryQuestionBankByTrainingPlanId',
    method: 'get',
    params
  })
}
// 试题提交
export function submitQuestionBank (data) {
  return Axios({
    url: '/app/train/submitQuestionBank',
    method: 'post',
    data
  })
}
// 考试记录
export function queryQuestionBankList (params) {
  return Axios({
    url: '/app/train/queryQuestionBankList',
    method: 'get',
    params
  })
}
// 考试记录详情
export function queryQuestionBankDetail (params) {
  return Axios({
    url: `/app/train/queryQuestionBankDetail?id=${params}`,
    method: 'get',
    params
  })
}

export function convertImageToBase64Str (url) {
  return Axios({
    url: `/app/common/convertImageToBase64Str?url=${url}`,
    method: 'get'
  })
}

// 是否可以开始跳转
export function queryQuestionBankByTrainingPlanIdValidate (params) {
  return Axios({
    url: '/app/train/queryQuestionBankByTrainingPlanIdValidate',
    method: 'get',
    params
  })
}
