api.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { $httpWithMsg } from "../../plugins/axios";
  2. import { QUESTION_API } from "@/constants/constants";
  3. // common select
  4. export const courseQueryApi = (name, enable) => {
  5. return $httpWithMsg.get(`${QUESTION_API}/course/query`, {
  6. params: {
  7. name,
  8. enable: enable || undefined,
  9. },
  10. });
  11. };
  12. export const propertyNameQueryApi = (courseId, name) => {
  13. return $httpWithMsg.get(`${QUESTION_API}/courseProperty/enable`, {
  14. params: {
  15. courseId,
  16. name,
  17. },
  18. });
  19. };
  20. export const propertyFirstQueryApi = (coursePropertyId) => {
  21. return $httpWithMsg.get(`${QUESTION_API}/property/first/${coursePropertyId}`);
  22. };
  23. export const propertySecondQueryApi = (firstPropertyId) => {
  24. return $httpWithMsg.get(`${QUESTION_API}/property/second/${firstPropertyId}`);
  25. };
  26. // question-manage
  27. export function questionPageListApi(data, { pageNo, pageSize }) {
  28. const url = `${QUESTION_API}/importPaper/${pageNo}/${pageSize}`;
  29. return $httpWithMsg.get(url, { params: data });
  30. }
  31. export function deleteQuestionApi(questionId) {
  32. return $httpWithMsg.get(`${QUESTION_API}/paper/deleteQuestion/${questionId}`);
  33. }
  34. export function moveQuestionApi(questionId, folderId) {
  35. return $httpWithMsg.get(`${QUESTION_API}/paper/moveQuestion/`, {
  36. params: { questionId, folderId },
  37. });
  38. }
  39. export function copyQuestionApi(questionId) {
  40. return $httpWithMsg.get(`${QUESTION_API}/paper/copyQuestion/`, {
  41. params: { questionId },
  42. });
  43. }
  44. export function importQuestionApi(data, headData) {
  45. return $httpWithMsg.post(`${QUESTION_API}/paper/copyQuestion/`, data, {
  46. headers: headData,
  47. });
  48. }