train.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import request from '@/common/request.js'
  2. /**
  3. * 开始训练了
  4. * @param mode
  5. * @param repoId
  6. * @param userId
  7. * @returns {*}
  8. */
  9. export function startTrain(mode, repoId, userId, clear) {
  10. return request.post('/api/repo/train/start', { mode: mode, repoId: repoId, userId: userId, clear: clear })
  11. }
  12. /**
  13. * 是否存在训练
  14. * @param mode
  15. * @param repoId
  16. * @param userId
  17. * @returns {*}
  18. */
  19. export function hasTrain(mode, repoId, userId) {
  20. return request.post('/api/repo/train/check', { mode: mode, repoId: repoId, userId: userId })
  21. }
  22. /**
  23. * 查找答题卡
  24. * @param mode
  25. * @param repoId
  26. * @param userId
  27. * @returns {*}
  28. */
  29. export function listCard(trainId) {
  30. return request.post('/api/repo/train/card', { id: trainId })
  31. }
  32. /**
  33. * 开始训练了
  34. * @param mode
  35. * @param repoId
  36. * @param userId
  37. * @returns {*}
  38. */
  39. export function fillResult(data) {
  40. return request.post('/api/repo/train/fill', data)
  41. }
  42. /**
  43. * 手动结束训练
  44. * @param trainId
  45. * @returns {*}
  46. */
  47. export function finishTrain(trainId) {
  48. return request.post('/api/repo/train/finish', { id: trainId })
  49. }
  50. /**
  51. * 查找训练题目详情
  52. * @param trainId
  53. * @param quId
  54. * @returns {Promise}
  55. */
  56. export function quDetail(trainId, quId) {
  57. return request.post('/api/repo/train/qu-detail', { trainId: trainId, quId: quId })
  58. }
  59. /**
  60. * 训练记录
  61. * @param {Object} data
  62. */
  63. export function trainPaging(data) {
  64. return request.post('/api/repo/train/paging', data)
  65. }