Files
5.24BuYu/Assets/MyGame/Scripts/Net/APIRequestList_Hall.cs
T
2026-07-25 01:32:54 +08:00

349 lines
13 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Assets.MyGame.Scripts.Net.API;
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
using Assets.MyGame.Scripts.Net.APIRequest.Params;
using Assets.MyGame.Scripts.Net.APIResponses;
using System;
using System.Collections.Generic;
namespace Assets.MyGame.Scripts.Net
{
public static partial class APIRequestList
{
#region Hall
/// <summary>
/// 存入保险箱(POST)
/// 参数:用户ID、存入金额
/// 返回:SafeBoxInfo(保险箱余额信息)
/// </summary>
public static void SaveSafeBox(SaveSafeBoxParam req, Action<SafeBoxInfo> callback)
{
APIManager.Response<SafeBoxInfo>(APIType.Hall_SaveSafeBox, req, callback);
}
/// <summary>
/// 获取保险箱信息(GET)
/// 参数:用户ID
/// 返回:SafeBoxInfo(保险箱余额信息)
/// </summary>
public static void GetSafeBox(Action<SafeBoxInfo> callback)
{
APIManager.Response<SafeBoxInfo>(APIType.Hall_GetSafeBox, callback);
}
/// <summary>
/// 取出保险箱(GET,带参数)
/// 参数:gold(取出数量)、password(保险箱密码)
/// 返回:SafeBoxInfo(取款后保险箱信息)
/// </summary>
public static void GetSafeBox(GetSafeBoxInfoParam req, Action<SafeBoxInfo> callback)
{
APIManager.Response<SafeBoxInfo>(APIType.Hall_GetSafeBox, req, callback);
}
/// <summary>
/// 设置保险箱密码(POST)
/// 参数:用户ID、新密码
/// 返回:StringBaseResponse(操作结果信息)
/// </summary>
public static void SetSafeBoxPassword(SetSafeBoxPasswordParam req, Action<StringBaseResponse> callback)
{
APIManager.Response<StringBaseResponse>(APIType.Hall_SetSafeBoxPassword, req, callback);
}
/// <summary>
/// 重置保险箱密码(POST)
/// 参数:用户ID、验证码
/// 返回:StringBaseResponse(操作结果信息)
/// </summary>
public static void ResetSafeBoxPassword(ResetSafeBoxPasswordParam req, Action<StringBaseResponse> callback)
{
APIManager.Response<StringBaseResponse>(APIType.Hall_ResetSafeBoxPassword, req, callback);
}
/// <summary>
/// 领取救济金(GET)
/// 参数:用户ID
/// 返回:GetReliefResponse(救济金数量、提示信息)
/// </summary>
public static void GetRelief(Action<GetReliefResponse> callback)
{
APIManager.Response<GetReliefResponse>(APIType.Hall_GetRelief, callback);
}
/// <summary>
/// 合成碎片(POST)
/// 参数:碎片ID、数量
/// 返回:PropInfo(道具信息)
/// </summary>
public static void SynthesisFragment(SynthesisFragmentParam req, Action<PropInfo> callback)
{
APIManager.Response<PropInfo>(APIType.Hall_SynthesisFragment, req, callback);
}
/// <summary>
/// 购买月卡(GET)
/// 参数:type(1=周卡 2=月卡 3=年卡)、gold(金币价)、money(现金价)
/// 返回:string(data 为结果描述字符串)
/// </summary>
public static void BuyMonthCard(BuyMonthCardParam req, Action<string> callback)
{
APIManager.Response<string>(APIType.Hall_BuyMonthCard, req, callback);
}
/// <summary>
/// 购买道具(GET)
/// 参数:propNumber(道具编号)、count(数量)
/// 返回:string(data 为结果描述字符串)
/// </summary>
public static void BuyProp(BuyPropParam req, Action<string> callback)
{
APIManager.Response<string>(APIType.Hall_BuyProp, req, callback);
}
/// <summary>
/// 购买金币(GET)
/// 参数:number(GoldShopConfig.number)、count(数量)
/// 返回:string(data 为结果描述字符串)
/// </summary>
public static void BuyGold(BuyGoldParam req, Action<string> callback)
{
APIManager.Response<string>(APIType.Hall_BuyGold, req, callback);
}
/// <summary>
/// 购买钻石(GET)
/// 参数:number(DiamondShopConfig.number)、count(数量)
/// 返回:string(data 为结果描述字符串)
/// </summary>
public static void BuyDiamond(BuyDiamondParam req, Action<string> callback)
{
APIManager.Response<string>(APIType.Hall_BuyDiamond, req, callback);
}
/// <summary>
/// 签到(GET)
/// 参数:用户ID
/// 返回:SignInfo(签到结果)
/// </summary>
public static void SignIn(Action<SignInfo> callback)
{
APIManager.Response<SignInfo>(APIType.Hall_SignIn, callback);
}
/// <summary>
/// 切换炮台(POST)
/// 参数:炮台ID
/// 返回:UserInfo(用户信息)
/// </summary>
public static void ChangeCannon(ChangeCannonParam req, Action<UserInfo> callback)
{
APIManager.Response<UserInfo>(APIType.Hall_ChangeCannon, req, callback);
}
/// <summary>
/// 切换翅膀(POST)
/// 参数:翅膀ID
/// 返回:UserInfo(用户信息)
/// </summary>
public static void ChangeWing(ChangeWingParam req, Action<UserInfo> callback)
{
APIManager.Response<UserInfo>(APIType.Hall_ChangeWing, req, callback);
}
/// <summary>
/// 切换战神(POST)
/// 参数:战神ID
/// 返回:UserInfo(用户信息)
/// </summary>
public static void ChangeGodWar(ChangeGodWarParam req, Action<UserInfo> callback)
{
APIManager.Response<UserInfo>(APIType.Hall_ChangeGodWar, req, callback);
}
/// <summary>
/// 领取 Vip 每日礼包(GET)
/// 返回:GiftInfo(礼包信息)
/// </summary>
public static void GetVipDayGift(Action<GiftInfo> callback)
{
APIManager.Response<GiftInfo>(APIType.Hall_GetVipDayGift, callback);
}
/// <summary>
/// 领取 Vip 权益礼包(GET)
/// 参数:用户ID
/// 返回:GiftInfo(礼包信息)
/// </summary>
public static void GetVipGift(Action<GiftInfo> callback)
{
APIManager.Response<GiftInfo>(APIType.Hall_GetVipGift, callback);
}
/// <summary>
/// 领取月卡每日礼包(GET)
/// 参数:用户ID
/// 返回:GiftInfo(礼包信息)
/// </summary>
public static void GetMonthCardDayGift(Action<GiftInfo> callback)
{
APIManager.Response<GiftInfo>(APIType.Hall_GetMonthCardDayGift, callback);
}
/// <summary>
/// 领取月卡权益礼包(GET)
/// 参数:用户ID
/// 返回:GiftInfo(礼包信息)
/// </summary>
public static void GetMonthCardGift( Action<GiftInfo> callback)
{
APIManager.Response<GiftInfo>(APIType.Hall_GetMonthCardGift,callback);
}
/// <summary>
/// 获取用户任务列表(Get)
/// 参数:用户ID
/// 返回:UserTaskListResponse(任务列表)
/// </summary>
public static void GetUserTaskList(Action<List<UserTaskDto>> callback)
{
APIManager.Response<List<UserTaskDto>>(APIType.Hall_GetUserTaskList,
new GetUserTaskListParam { taskType = -1 }, callback);
}
/// <summary>
/// 发放奖励(POST)
/// 参数:奖励ID、用户ID
/// 返回:RewardInfo(奖励信息)
/// </summary>
public static void DistributeRewards(DistributeRewardsParam req, Action<RewardInfo> callback)
{
APIManager.Response<RewardInfo>(APIType.Hall_DistributeRewards, req, callback);
}
/// <summary>
/// 使用刮刮卡抽奖(GET,无参)
/// 返回:ScratchCardResult(抽奖结果:prizeType/prizeName/count/baseProduct)
/// </summary>
public static void ScratchCardDraw(Action<ScratchCardResult> callback)
{
APIManager.Response<ScratchCardResult>(APIType.Hall_ScratchCardDraw, callback);
}
/// <summary>
/// 获取资产变动记录(GET)
/// 参数:keyWord/pageIndex/pageSize/userId/type/source/currencyType
/// 返回:List&lt;UserRewardDto&gt;
/// </summary>
public static void GetUserRewardList(GetUserRewardListObj req, Action<List<UserRewardDto>> callback)
{
APIManager.Response<List<UserRewardDto>>(APIType.Hall_GetUserRewardList, req, callback);
}
// ==================== 战令 ====================
/// <summary>获取用户战令信息(GET)</summary>
public static void GetBattleOrder(Action<BattleOrderResponse> callback)
{
APIManager.Response<BattleOrderResponse>(APIType.Hall_GetBattleOrder, callback);
}
/// <summary>一键领取战令奖励(GET)</summary>
public static void ReceiveAllBattleOrderRewards(Action<List<GiftConfig>> callback)
{
APIManager.Response<List<GiftConfig>>(APIType.Hall_ReceiveAllBattleOrderRewards, callback);
}
/// <summary>领取指定等级战令奖励(GET)</summary>
public static void ReceiveBattleOrderLevelReward(ReceiveBattleOrderLevelRewardParam req, Action<List<GiftConfig>> callback)
{
APIManager.Response<List<GiftConfig>>(APIType.Hall_ReceiveBattleOrderLevelReward, req, callback);
}
/// <summary>购买战令等级(GET)</summary>
public static void BuyBattleOrderLevel(BuyBattleOrderLevelParam req, Action<BuyBattleOrderLevelResponse> callback)
{
APIManager.Response<BuyBattleOrderLevelResponse>(APIType.Hall_BuyBattleOrderLevel, req, callback);
}
/// <summary>购买战令进阶(GET)</summary>
public static void BuyBattleOrderAdvance(BuyBattleOrderAdvanceParam req, Action<BuyBattleOrderAdvanceResponse> callback)
{
APIManager.Response<BuyBattleOrderAdvanceResponse>(APIType.Hall_BuyBattleOrderAdvance, req, callback);
}
// ==================== 排行榜 ====================
/// <summary>
/// 获取用户排行榜(GET)
/// 参数:type(1=金币排名 2=等级排名 3=今日消耗排名)
/// 返回:RankingResponse(排行榜列表 + 当前用户排行)
/// </summary>
public static void GetRanking(GetRankingParam req, Action<RankingResponse> callback)
{
APIManager.Response<RankingResponse>(APIType.Hall_GetRanking, req, callback);
}
/// <summary>
/// 获取象棋分区总数(GET,无参)
/// 返回:int
/// </summary>
public static void GetChessRoomPartitionCount(Action<int> callback)
{
APIManager.Response<int>(APIType.Hall_GetChessRoomPartitionCount, callback);
}
/// <summary>
/// 发送全服广播(GET /api/Hall/SendBroadcast?message=xxx)
/// 返回:string
/// </summary>
public static void SendBroadcast(string message, Action<string> callback = null)
{
APIManager.Response<string>(APIType.Hall_SendBroadcast, new SendBroadcastParam
{
message = message
}, callback);
}
/// <summary>
/// 获取房间专属 socket 地址(GET /api/Room/Assign?roomId=xxx)
/// 返回:string(如 ws://8.137.163.153/fishinghub?instance=1)
/// </summary>
public static void RoomAssign(string roomId, Action<string> callback)
{
APIManager.Response<string>(APIType.Room_Assign, new RoomAssignParam
{
roomId = roomId
}, callback);
}
/// <summary>
/// 快速加入房间(GET /api/Room/QuickJoin?gameType=&level=)
/// 返回:QuickJoinResponse(roomId + url)
/// 后端自动分配房间和座位,客户端拿到后用 url 连 socket,再调 JoinRoom(roomId, userId, -1)
/// </summary>
public static void RoomQuickJoin(int gameType, int level, Action<QuickJoinResponse> callback)
{
APIManager.Response<QuickJoinResponse>(APIType.Room_QuickJoin, new RoomQuickJoinParam
{
gameType = gameType,
level = level
}, callback);
}
/// <summary>
/// 使用VIP经验包(GET /api/Hall/UseVipExp?count=)
/// 返回:string
/// </summary>
/// <param name="count">使用数量(默认1)</param>
public static void UseVipExp(int count = 1, Action<string> callback = null)
{
APIManager.Response<string>(APIType.Hall_UseVipExp, new UseVipExpParam { count = count }, callback);
}
#endregion
}
}