import BaseAPI from './base_api'

export default class ExamAPI extends BaseAPI {
  /**
   * 获取考试信息
   * @param {[string]} examId resource_id
   */
  getTopic = (examId) => this.get(`/ehall/v1/exam/sheet/${examId}`, {})
  /* 缓存考试 */
  setCache = (examId = {}, obj = {}) => this.post(`/ehall/v1/exam/cache/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  /* 获取缓存 */
  getCache = (examId) => this.get(`/ehall/v1/exam/cache/${examId}`, {})
  /* 缓存考试 */
  endExam = (examId = {}, obj = {}) => this.post(`/ehall/v1/exam/sheet/${examId}`, obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  /**
   * 进入考试
   */
  // userLogin = (obj = {}) => this.post('/ehall/v1/user/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  // confirmInfo = (obj = {}) => this.post('/ehall/v1/user/confirm', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  // /**
  //  * post传输方式
  //  * @param {[object]} obj
  //  */
  // postTest = (obj = {}) => this.post('/passport/rest/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
  // /**
  // * 当前登录用户，检测是否该系统有权限
  // */
  // getInfo = () => this.post('/user_center/get_user_info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
}
