/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-06-21 13:55:42
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-06-22 17:36:17
 * @FilePath: \base-in-front-end-master1\src\api\paperApi.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import HttpKit from '@/utils/http-kit'

export default {
  /**
   * 功能描述：查询试卷
   * @param form
   */
  page (form) {
    return HttpKit.post(`http://127.0.0.1:8080/base-in-back-end/common/paper/page`, form).then(
      res => res.data,
    )
  },
  /**
   * 功能描述：新增试卷
   * @param form
   */
  Update (form) {
    return HttpKit.post(`http://127.0.0.1:8080/base-in-back-end/common/paper`,form).then(

      //res => res.data
    )
  },
  /**
   * 功能描述：根据Id删除试卷
   * @param paperId
   */
  deleteByPaperId (paperId) {
    return HttpKit.delete(`http://127.0.0.1:8080/base-in-back-end/common/paper/rf/${paperId}`).then(
      res => res.body
    )
  },

  preview (paperId) {
    return HttpKit.get(`http://127.0.0.1:8080/base-in-back-end/common/paper/${paperId}/topic`).then(res=>res.data
    )
  },
  showStem(stemId) {
    //todo
    // return HttpKit.get(`http://112.74.105.17:20003/question-bank/api/stem/${stemId}`).then(res=>res.data)
    return HttpKit.get(`http://127.0.0.1:8080/question-bank/api/stem/${stemId}`).then(res=>res.data)
  }
}
