import { http } from '../http'
import { get, post } from '../request'

const doWorkApi = {
  /*
   ** 答题
   */
  // 训练记录表-新增
  addTrain: async (data: anyObj) => {
    return await post<any>('/userTrainRecord', data)
  },

  // 训练记录表-id查询
  getTrainSingle: async (id: any): Promise<any> => {
    return await get('/userTrainRecord/' + id)
  },

  // 训练记录表-查询列表
  getTrainRecordList: async (params: anyObj) => {
    return await get<any>('/userTrainRecord/list', params)
  },

  // 训练记录表-查询列表
  submitTrainRecord: async (data: anyObj) => {
    return await post('/userTrainRecord/submitTrainRecord', data)
  },

  // 题目反馈表-新增
  submitTitleFeedback: (data: anyObj) =>
    http.request({
      url: '/titleFeedback',
      data,
      method: 'POST',
    }),

  // 用户组卷表-开始组卷
  startGroupPaper: (data: anyObj) =>
    http.request({
      url: '/userPaper/start',
      data,
      method: 'POST',
      timeout: 28000,
    }),
}

export default doWorkApi
