examine.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /**
  2. * 授权 API
  3. */
  4. import {
  5. http
  6. } from '../request/main.js'
  7. /**
  8. * 开始答题
  9. *
  10. * @returns {Promise}
  11. */
  12. export function startChallenge() {
  13. return http.post('/examine/startChallenge')
  14. }
  15. /**
  16. * 获取新题
  17. *
  18. * @returns {Promise}
  19. */
  20. export function getNew(session_id) {
  21. return http.post('/examine/getNew', {
  22. session_id
  23. })
  24. }
  25. /**
  26. * 提交答案
  27. *
  28. * @returns {Promise}
  29. */
  30. export function submitAnswer(id, answer) {
  31. return http.post('/examine/submitAnswer', {
  32. id,
  33. answer
  34. })
  35. }
  36. /**
  37. * 获取考核结果
  38. *
  39. * @returns {Promise}
  40. */
  41. export function getSummary(session_id) {
  42. return http.post('/examine/getSummary', {
  43. session_id
  44. })
  45. }
  46. /**
  47. * 获取考核历史
  48. *
  49. * @returns {Promise}
  50. */
  51. export function getHistory(session_id, page, page_size) {
  52. return http.post('/examine/getHistory', {
  53. session_id,
  54. page,
  55. page_size
  56. })
  57. }
  58. /**
  59. * 获取答题结果
  60. *
  61. * @returns {Promise}
  62. */
  63. export function getResult(id) {
  64. return http.post('/examine/getResult', {
  65. id
  66. })
  67. }
  68. /**
  69. * 获取排行数据
  70. *
  71. * @returns {Promise}
  72. */
  73. export function getTopList(group, page, page_size) {
  74. return http.post('/examine/getTopList', {
  75. group,
  76. page,
  77. page_size
  78. })
  79. }
  80. /**
  81. * 获取我的排行
  82. *
  83. * @returns {Promise}
  84. */
  85. export function getMineTop(group) {
  86. return http.post('/examine/getMineTop', {
  87. group
  88. })
  89. }
  90. /**
  91. * 获取全部排行和个人排行
  92. * 比赛专用
  93. *
  94. * @returns {Promise}
  95. */
  96. export function getRankingList() {
  97. return http.post('/examine/getRankingList', {})
  98. }
  99. /**
  100. * 分享点赞获取奖励
  101. *
  102. * @returns {Promise}
  103. */
  104. export function userShare(share_user_id) {
  105. return http.post('/common/userShare', {
  106. share_user_id
  107. })
  108. }