UserInformationApi.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. const Api = require('../net/Api');
  2. class UserInformationApi {
  3. /*
  4. * 获取用户信息接口
  5. * @param uid [string] 用户id
  6. * */
  7. getUserInformation(uid, success, fail) {
  8. let url = "/user/getInfo.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. getTimelineList(uid, success, fail) {
  23. let url = "/post/getPost.do";
  24. let data = {
  25. targetUid: uid
  26. };
  27. let requestBody = {
  28. url: url,
  29. data: data,
  30. success: success,
  31. fail: fail,
  32. complete: () => {
  33. }
  34. };
  35. Api.httpGet(requestBody);
  36. }
  37. postRelate(uid, type, success, fail) {
  38. let url = "/friend/relate.do";
  39. let data = {
  40. targetUid: uid,
  41. opt: type,
  42. };
  43. let requestBody = {
  44. url: url,
  45. data: data,
  46. success: success,
  47. fail: fail,
  48. complete: () => {
  49. }
  50. };
  51. Api.httpPost(requestBody);
  52. }
  53. editArtistName(uid, name, success, fail) {
  54. let url = "/user/updateArtistName.do";
  55. let data = {
  56. targetUid: uid,
  57. artistName: name,
  58. };
  59. let requestBody = {
  60. url: url,
  61. data: data,
  62. success: success,
  63. fail: fail,
  64. complete: () => {
  65. }
  66. };
  67. Api.httpPost(requestBody);
  68. }
  69. postInteract(uid, type, success, fail) {
  70. let url = "/friend/interact.do";
  71. let data = {
  72. targetUid: uid,
  73. type: type,
  74. };
  75. let requestBody = {
  76. url: url,
  77. data: data,
  78. success: success,
  79. fail: fail,
  80. complete: () => {
  81. }
  82. };
  83. Api.httpPost(requestBody);
  84. }
  85. getRelationCondition(uid, opt, success, fail) {
  86. let url = "/item/getCondition.do";
  87. let data = {
  88. targetUid: uid,
  89. opt: opt
  90. };
  91. let requestBody = {
  92. url: url,
  93. data: data,
  94. success: success,
  95. fail: fail,
  96. complete: () => {
  97. }
  98. };
  99. Api.httpGet(requestBody);
  100. }
  101. postSpeedInteraction(uid, success, fail) {
  102. let url = "/friend/speedInteraction.do";
  103. let data = {
  104. targetUid: uid
  105. };
  106. let requestBody = {
  107. url: url,
  108. data: data,
  109. success: success,
  110. fail: fail,
  111. complete: () => {
  112. }
  113. };
  114. Api.httpPost(requestBody);
  115. }
  116. }
  117. module.exports = new UserInformationApi();