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