123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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 recallStar(starId, success, fail) {
- let url = "/star/delStarRoom";
- let body = {
- "starId": starId,
- };
- Api.httpPost(this.setRequestBody(url, body, success, fail));
- }
- /// 把某个明星随机分配到房间
- static dispatchStar(starId, success, fail) {
- let url = "/star/starRoom";
- let body = {
- "starId": starId,
- };
- Api.httpPost(this.setRequestBody(url, body, success, fail));
- }
- /// 召回全部明星
- static recallAllStar(success, fail) {
- let url = "/star/delAllStarRoom";
- Api.httpPost(this.setRequestBody(url, {}, success, fail));
- }
- static setRequestBody(url, data, success, fail) {
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- return requestBody;
- }
- }
- module.exports = StarApi;
|