1
0

PackApi.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. const Api = require('../net/Api');
  2. class PackApi {
  3. /*
  4. * 获取用户插卡信息
  5. * @param uid [string] 用户id
  6. * */
  7. static getUserCardsInfo(uid, success, fail) {
  8. let url = "/item/getCards.do";
  9. let data = {
  10. targetUid: uid
  11. };
  12. let requestBody = {
  13. url: url,
  14. data: data,
  15. success: success,
  16. fail: fail,
  17. complete: () => {
  18. }
  19. };
  20. Api.httpGet(requestBody);
  21. }
  22. static postInsertCard(uid, itemId, success, fail) {
  23. let url = "/item/insertCard.do";
  24. let data = {
  25. targetUid: uid,
  26. itemId: itemId
  27. };
  28. let requestBody = {
  29. url: url,
  30. data: data,
  31. success: success,
  32. fail: fail,
  33. complete: () => {
  34. }
  35. };
  36. Api.httpPost(requestBody);
  37. }
  38. static postUnloadCard(uid, itemId, success, fail) {
  39. let url = "/item/unload.do";
  40. let data = {
  41. targetUid: uid,
  42. itemId: itemId,
  43. };
  44. let requestBody = {
  45. url: url,
  46. data: data,
  47. success: success,
  48. fail: fail,
  49. complete: () => {
  50. }
  51. };
  52. Api.httpPost(requestBody);
  53. }
  54. static getUserPackInfo(success, fail) {
  55. let url = "/user/getUserPackInfo.do";
  56. let data = {};
  57. let requestBody = {
  58. url: url,
  59. data: data,
  60. success: success,
  61. fail: fail,
  62. complete: () => {
  63. }
  64. };
  65. Api.httpGet(requestBody);
  66. };
  67. }
  68. module.exports = PackApi;