import request from '@/config/axios'

// 问卷结果-详情 VO
export interface QuestionnaireResultDetailsVO {
  id: number // id
  bqrdUserId: number // 用户id
  bqrdQuestionnaireResultId: number // 答卷结果id
  bqrdQuestionnaireId: number // 问卷id
  bqrdQuestionId: number // 试题id
  bqrdQuestOptionId: number // 选择
  bqrdIsCorrect: string // 是否答对
  bqrdQuestSorce: number // 试题得分
  tenantId: Number // 租户id
}

// 问卷结果-详情 API
export const QuestionnaireResultDetailsApi = {
  // 查询问卷结果-详情分页
  getQuestionnaireResultDetailsPage: async (params: any) => {
    return await request.get({ url: `/bjdxResult/questionnaire-result-details/page`, params })
  },

  // 查询问卷结果-详情详情
  getQuestionnaireResultDetails: async (id: number) => {
    return await request.get({ url: `/bjdxResult/questionnaire-result-details/get?id=` + id })
  },

  // 新增问卷结果-详情
  createQuestionnaireResultDetails: async (data: QuestionnaireResultDetailsVO) => {
    return await request.post({ url: `/bjdxResult/questionnaire-result-details/create`, data })
  },

  // 修改问卷结果-详情
  updateQuestionnaireResultDetails: async (data: QuestionnaireResultDetailsVO) => {
    return await request.put({ url: `/bjdxResult/questionnaire-result-details/update`, data })
  },

  // 删除问卷结果-详情
  deleteQuestionnaireResultDetails: async (id: number) => {
    return await request.delete({ url: `/bjdxResult/questionnaire-result-details/delete?id=` + id })
  },

  // 导出问卷结果-详情 Excel
  exportQuestionnaireResultDetails: async (params) => {
    return await request.download({ url: `/bjdxResult/questionnaire-result-details/export-excel`, params })
  }
}
