1
0

ArtistTrainApi.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. const Api = require('../net/Api');
  2. class ArtistTrainApi {
  3. /**
  4. * 获取艺人的培养列表
  5. * @param {int} targetUid 艺人的 uid
  6. * @param {*} success
  7. * @param {*} fail
  8. */
  9. static missionGetTrainings(targetUid, success, fail) {
  10. let url = "/mission/getTrainings.do";
  11. let data = {
  12. targetUid: targetUid,
  13. };
  14. let requestBody = {
  15. url: url,
  16. data: data,
  17. success: success,
  18. fail: fail,
  19. complete: () => {
  20. }
  21. };
  22. Api.httpGet(requestBody);
  23. }
  24. /**
  25. * 艺人培养
  26. * @param {int} targetUid 艺人的 uid
  27. * @param {int} missionId 任务id
  28. * @param {*} success
  29. * @param {*} fail
  30. */
  31. static missionTrains(targetUid, missionId, success, fail) {
  32. let url = "/mission/train.do";
  33. let data = {
  34. targetUid: targetUid,
  35. missionId: missionId
  36. };
  37. let requestBody = {
  38. url: url,
  39. data: data,
  40. success: success,
  41. fail: fail,
  42. complete: () => {
  43. }
  44. };
  45. Api.httpPost(requestBody);
  46. }
  47. /**
  48. * 获取培养成果
  49. * @param {int} targetUid 艺人的 uid
  50. * @param {int} missionId 任务id
  51. * @param {*} success
  52. * @param {*} fail
  53. */
  54. static missionGain(targetUid, missionId, success, fail) {
  55. let url = "/mission/gain.do";
  56. let data = {
  57. targetUid: targetUid,
  58. missionId: missionId
  59. };
  60. let requestBody = {
  61. url: url,
  62. data: data,
  63. success: success,
  64. fail: fail,
  65. complete: () => {
  66. }
  67. };
  68. Api.httpPost(requestBody);
  69. }
  70. /**
  71. * 加速培养任务
  72. * @param {int} targetUid 艺人的 uid
  73. * @param {int} missionId 任务id
  74. * @param {*} success
  75. * @param {*} fail
  76. */
  77. static missionSpeedUp(targetUid, missionId, success, fail) {
  78. let url = "/mission/speedUp.do";
  79. let data = {
  80. targetUid: targetUid,
  81. missionId: missionId
  82. };
  83. let requestBody = {
  84. url: url,
  85. data: data,
  86. success: success,
  87. fail: fail,
  88. complete: () => {
  89. }
  90. };
  91. Api.httpPost(requestBody);
  92. }
  93. }
  94. module.exports = ArtistTrainApi;