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