12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- 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;
|