12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- const Api = require('./Api');
- class StarApi {
- /**
- * 获取所有标注(可以签约的明星)信息
- */
- static getSignStars(success, fail) {
- let url = "/star/getSignStars";
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- /// 获取所有明星
- static getAllStars(success, fail) {
- let url = "/star/getAllStars";
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- /// 购买某个明星
- static buyStar(starId, success, fail) {
- let url = "/star/buyStar";
- let body = {
- "starId": starId,
- };
- Api.httpPost(this.setRequestBody(url, body, success, fail));
- }
- static setRequestBody(url, data, success, fail) {
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- return requestBody;
- }
- }
- module.exports = StarApi;
|