123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- const Api = require('./Api');
- class HomeApi {
- /**
- * 获取我的小程序礼包
- */
- static getUserBuildings(success, fail) {
- let url = "/room/getAllRooms.do";
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- /**
- * 上报接口
- * @param {*} reportFormInfo {"grossIncome":1000,"grossRate":10000,"stars":1}
- * @param {*} success
- * @param {*} fail
- */
- static userReportGross(reportFormInfo, success, fail) {
- let url = "/room/reportGold.do";
- let data = {
- reportFormInfo: reportFormInfo,
- };
- Api.httpPost(this.setRequestBody(url, data, success, fail));
- }
- //上报楼层等级接口
- static userReportRooms(reportFormInfo, success, fail) {
- let url = "/room/reportRooms.do";
- let data = {
- reportFormInfo: reportFormInfo,
- };
- Api.httpPost(this.setRequestBody(url, data, success, fail));
- }
- /**
- * 举报艺人
- * @param {*} formmInfoJson
- * @param {*} success
- * @param {*} fail
- */
- static getAppletAward(success, fail) {
- let url = "/user/appletAward.do";
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- //领取房间里程碑奖励
- static getRoomAward(roomId, level, success, fail) {
- let url = "/room/award.do";
- let data = {
- roomId: roomId,
- level: level
- };
- Api.httpPost(this.setRequestBody(url, data, success, fail));
- }
- // 退出游戏
- static exitGame(success, fail) {
- let url = "/user/exitGame.do";
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
-
- static getInformation(success, fail) {
- let url = '/information/getInformation';
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
-
- /// 上报免费看广告升级的次数
- /// 上报类型1升级总部大楼,2升级房间等级,3购买明星
- static reportInformation(type, success, fail) {
- let url = '/information/report';
- let data = {
- 'type': type
- }
- Api.httpPost(this.setRequestBody(url, data, success, fail));
- }
- /**
- *
- * 获取每日时间段奖励状态
- * @static
- * @param {*} success
- * @param {*} fail
- * @memberof HomeApi
- */
- static getReward(success, fail) {
- let url = '/user/getReward';
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- /**
- *
- * 领取每日时间段奖励
- * @static
- * @param {*} success
- * @param {*} fail
- * @memberof HomeApi
- */
- static reward(success, fail) {
- let url = '/user/reward';
- Api.httpGet(this.setRequestBody(url, {}, success, fail));
- }
- // //// 获取用户商品信息
- // static getUserShopData() {
- // let url = '/shop/getUserShops';
- // Api.httpGet(this.setRequestBody(url, {}, success, fail));
- // }
- // 生成一个 RequestBody, 总是要写重复代码, 太恶心了
- static setRequestBody(url, data, success, fail) {
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- return requestBody;
- }
-
- }
- module.exports = HomeApi;
|