1
0

HomeApi.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. const Api = require('../net/Api');
  2. class HomeApi {
  3. /**
  4. * 获取目标用户的建筑
  5. * @param targetUid [long] 目标用户,当前用户就传自己的uid 的值
  6. * @param cityId [long] 城市 id
  7. */
  8. static getUserBuildings(targetUid, cityId, success, fail) {
  9. let url = "/building/getUserBuildings.do";
  10. let data = {
  11. targetUid: targetUid,
  12. cityId: cityId,
  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 buildingId [int] 建筑Id
  27. * @param cityId [int] 城市id
  28. * @param grossIncome [int] 当前总金币数
  29. * @param grossRate [int] 自动收入金额
  30. * @param level [int] 建筑等级
  31. * @param stars [int] 星星数
  32. *
  33. * */
  34. static buildingUpGrade(formmInfoJson, success, fail) {
  35. let url = "/building/upGrade.do";
  36. let data = {
  37. formInfo: formmInfoJson,
  38. };
  39. let requestBody = {
  40. url: url,
  41. data: data,
  42. success: success,
  43. fail: fail,
  44. complete: () => {
  45. }
  46. };
  47. Api.httpPost(requestBody);
  48. }
  49. /**
  50. * 获取首页好友列表
  51. * */
  52. static getFriends(success, fail) {
  53. let url = "/friend/getIndexList.do";
  54. let data = {};
  55. let requestBody = {
  56. url: url,
  57. data: data,
  58. success: success,
  59. fail: fail,
  60. complete: () => {
  61. }
  62. };
  63. Api.httpGet(requestBody);
  64. }
  65. /**
  66. * 主界面艺人管理列表
  67. */
  68. static getFriendManageList(success, fail) {
  69. let url = "/friend/getManageList.do";
  70. let data = {};
  71. let requestBody = {
  72. url: url,
  73. data: data,
  74. success: success,
  75. fail: fail,
  76. complete: () => {
  77. }
  78. };
  79. Api.httpGet(requestBody);
  80. }
  81. /**
  82. * 上报接口
  83. * @param {*} reportFormInfo {"grossIncome":1000,"grossRate":10000,"stars":1}
  84. * @param {*} success
  85. * @param {*} fail
  86. */
  87. static userReportGross(reportFormInfo, success, fail) {
  88. let url = "/building/report.do";
  89. let data = {
  90. reportFormInfo: reportFormInfo,
  91. };
  92. let requestBody = {
  93. url: url,
  94. data: data,
  95. success: success,
  96. fail: fail,
  97. complete: () => {
  98. }
  99. };
  100. Api.httpPost(requestBody);
  101. }
  102. /**
  103. * 获取好友艺人列表
  104. * @param {int} fid 好友uid
  105. * @param {*} success
  106. * @param {*} fail
  107. */
  108. static friendGetArtists(fid, success, fail) {
  109. let url = "/friend/getArtists.do";
  110. let data = {
  111. fid: fid,
  112. };
  113. let requestBody = {
  114. url: url,
  115. data: data,
  116. success: success,
  117. fail: fail,
  118. complete: () => {
  119. }
  120. };
  121. Api.httpGet(requestBody);
  122. }
  123. }
  124. module.exports = HomeApi;