123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- const Api = require('../net/Api');
- class HomeApi {
- /**
- * 获取目标用户的建筑
- * @param targetUid [long] 目标用户,当前用户就传自己的uid 的值
- * @param cityId [long] 城市 id
- */
- static getUserBuildings(targetUid, cityId, success, fail) {
- let url = "/building/getUserBuildings.do";
- let data = {
- targetUid: targetUid,
- cityId: cityId,
- };
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpGet(requestBody);
- }
- /**
- * 升级建筑
- * @param buildingId [int] 建筑Id
- * @param cityId [int] 城市id
- * @param grossIncome [int] 当前总金币数
- * @param grossRate [int] 自动收入金额
- * @param level [int] 建筑等级
- * @param stars [int] 星星数
- *
- * */
- static buildingUpGrade(formmInfoJson, success, fail) {
- let url = "/building/upGrade.do";
- let data = {
- formInfo: formmInfoJson,
- };
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpPost(requestBody);
- }
- /**
- * 获取首页好友列表
- * */
- static getFriends(success, fail) {
-
- let url = "/friend/getIndexList.do";
- let data = {};
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpGet(requestBody);
- }
- /**
- * 主界面艺人管理列表
- */
- static getFriendManageList(success, fail) {
- let url = "/friend/getManageList.do";
- let data = {};
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpGet(requestBody);
- }
- /**
- * 上报接口
- * @param {*} reportFormInfo {"grossIncome":1000,"grossRate":10000,"stars":1}
- * @param {*} success
- * @param {*} fail
- */
- static userReportGross(reportFormInfo, success, fail) {
- let url = "/building/report.do";
- let data = {
- reportFormInfo: reportFormInfo,
- };
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpPost(requestBody);
- }
- /**
- * 获取好友艺人列表
- * @param {int} fid 好友uid
- * @param {*} success
- * @param {*} fail
- */
- static friendGetArtists(fid, success, fail) {
- let url = "/friend/getArtists.do";
- let data = {
- fid: fid,
- };
- let requestBody = {
- url: url,
- data: data,
- success: success,
- fail: fail,
- complete: () => {
- }
- };
- Api.httpGet(requestBody);
- }
- }
- module.exports = HomeApi;
|