StarApi.js 999 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const Api = require('./Api');
  2. class StarApi {
  3. /**
  4. * 获取所有标注(可以签约的明星)信息
  5. */
  6. static getSignStars(success, fail) {
  7. let url = "/star/getSignStars";
  8. Api.httpGet(this.setRequestBody(url, {}, success, fail));
  9. }
  10. /// 获取所有明星
  11. static getAllStars(success, fail) {
  12. let url = "/star/getAllStars";
  13. Api.httpGet(this.setRequestBody(url, {}, success, fail));
  14. }
  15. /// 购买某个明星
  16. static buyStar(starId, success, fail) {
  17. let url = "/star/buyStar";
  18. let body = {
  19. "starId": starId,
  20. };
  21. Api.httpPost(this.setRequestBody(url, body, success, fail));
  22. }
  23. static setRequestBody(url, data, success, fail) {
  24. let requestBody = {
  25. url: url,
  26. data: data,
  27. success: success,
  28. fail: fail,
  29. complete: () => {
  30. }
  31. };
  32. return requestBody;
  33. }
  34. }
  35. module.exports = StarApi;