1
0

UserInformationApi.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. }
  86. module.exports = new UserInformationApi();