square.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import {axios} from '../utils/request'
  2. import {SQUARE_MODULE} from "./_prefix";
  3. export const getSharedFileList = userId => {
  4. return axios.get(`${SQUARE_MODULE}/sharedFileList`, {
  5. params: {
  6. userId: userId
  7. }
  8. }).then(res => {
  9. return res;
  10. }
  11. )
  12. }
  13. export const getCollectFileList = userId => {
  14. return axios.get(`${SQUARE_MODULE}/collectFileList`, {
  15. params: {
  16. userId: userId
  17. }
  18. }).then(res => {
  19. return res;
  20. }
  21. )
  22. }
  23. export const getSharedModelList = userId => {
  24. return axios.get(`${SQUARE_MODULE}/sharedModelList`, {
  25. params: {
  26. userId: userId
  27. }
  28. }).then(res => {
  29. return res;
  30. }
  31. )
  32. }
  33. export const getCollectModelList = userId => {
  34. return axios.get(`${SQUARE_MODULE}/collectModelList`, {
  35. params: {
  36. userId: userId
  37. }
  38. }).then(res => {
  39. return res;
  40. }
  41. )
  42. }
  43. export const shareFile = payload => {
  44. const {userId, fileId} = payload;
  45. return axios.post(`${SQUARE_MODULE}/shareFile?userId=${userId}&fileId=${fileId}`).then( res => {
  46. return res;
  47. });
  48. }
  49. export const shareModel = payload => {
  50. const {userId, modelId} = payload;
  51. return axios.post(`${SQUARE_MODULE}/shareModel?userId=${userId}&modelId=${modelId}`).then( res => {
  52. return res;
  53. });
  54. }
  55. export const collectFile = payload => {
  56. const {userId, fileId} = payload;
  57. return axios.post(`${SQUARE_MODULE}/collectFile?userId=${userId}&fileId=${fileId}`).then( res => {
  58. return res;
  59. });
  60. }
  61. export const collectModel = payload => {
  62. const {userId, modelId} = payload;
  63. return axios.post(`${SQUARE_MODULE}/collectModel?userId=${userId}&modelId=${modelId}`).then( res => {
  64. return res;
  65. });
  66. }