import request from '@/config/axios'

// 课程-试题 VO
export interface CourseQuestionVO {
  id: number // 课程试题id
  cqQuestion: string // 试题内容
  cqQuestAnalysis: string // 试题解析
  cqQuestType: string // 试题类型
  cqQuestAnswerId: number // 试题答案id
  tenantId: Number // 租户id
}

// 课程-试题 API
export const CourseQuestionApi = {
  // 查询课程-试题分页
  getCourseQuestionPage: async (params: any) => {
    return await request.get({ url: `/bjdx/course-question/page`, params })
  },

  // 查询课程-试题详情
  getCourseQuestion: async (id: number) => {
    return await request.get({ url: `/bjdx/course-question/get?id=` + id })
  },

  // 新增课程-试题
  createCourseQuestion: async (data: CourseQuestionVO) => {
    return await request.post({ url: `/bjdx/course-question/create`, data })
  },

  // 修改课程-试题
  updateCourseQuestion: async (data: CourseQuestionVO) => {
    return await request.put({ url: `/bjdx/course-question/update`, data })
  },

  // 删除课程-试题
  deleteCourseQuestion: async (id: number) => {
    return await request.delete({ url: `/bjdx/course-question/delete?id=` + id })
  },

  // 导出课程-试题 Excel
  exportCourseQuestion: async (params) => {
    return await request.download({ url: `/bjdx/course-question/export-excel`, params })
  }
}
