174 lines
5.9 KiB
C#
174 lines
5.9 KiB
C#
using Assets.MyGame.Scripts.Net.API;
|
||
using Assets.MyGame.Scripts.Net.APIRequest;
|
||
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
|
||
using Assets.MyGame.Scripts.Net.APIRequest.Params;
|
||
using Assets.MyGame.Scripts.Net.APIResponses;
|
||
using Assets.MyGame.Scripts.Net.APIResponses.HomeMain_User;
|
||
using Newtonsoft.Json.Linq;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
|
||
namespace Assets.MyGame.Scripts.Net
|
||
{
|
||
public static partial class APIRequestList
|
||
{
|
||
#region User_Email
|
||
|
||
/// <summary>
|
||
/// 获取邮件列表(POST)
|
||
/// 参数:keyWord / pageIndex / pageSize / readStatus
|
||
/// 返回:GetEmailByPageResponse(邮件列表,分页)
|
||
/// </summary>
|
||
public static void GetEmailByPage(GetEmailByPageObj req, Action<List<GetEmailByPageResponse>> callback)
|
||
{
|
||
APIManager.Response<List<GetEmailByPageResponse>>(APIType.User_GetEmailByPage, req, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取邮件详情,未读自动变为已读(GET)
|
||
/// 参数:邮件 id (Param)
|
||
/// 返回:GetEmailByPageResponse(单封邮件)
|
||
/// </summary>
|
||
public static void GetEmail(GetEmailParam req, Action<GetEmailByPageResponse> callback)
|
||
{
|
||
APIManager.Response<GetEmailByPageResponse>(APIType.User_GetEmail, req, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 领取邮箱奖励(GET)
|
||
/// 参数:邮件 id (Param)
|
||
/// 返回:string(结果提示)
|
||
/// </summary>
|
||
public static void RewardEmail(RewardEmailParam req, Action<JObject> callback)
|
||
{
|
||
APIManager.Response<JObject>(APIType.User_RewardEmail, req, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除已读邮件(GET)
|
||
/// 参数:邮件 id (Param)
|
||
/// 返回:string(结果提示)
|
||
/// </summary>
|
||
public static void DeleteEmail(DeleteEmailParam req, Action<JObject> callback)
|
||
{
|
||
APIManager.Response<JObject>(APIType.User_DeleteEmail, req, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 一键阅读所有未读邮件(GET,无参)
|
||
/// 返回:string(结果提示)
|
||
/// </summary>
|
||
public static void ReadEmailMore(Action<JObject> callback)
|
||
{
|
||
APIManager.Response<JObject>(APIType.User_ReadEmailMore, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取未读邮件数量(GET,无参)
|
||
/// 返回:long(未读数量)
|
||
/// </summary>
|
||
public static void GetNoReadCount(Action<long> callback)
|
||
{
|
||
APIManager.Response<long>(APIType.User_GetNoReadCount, callback);
|
||
}
|
||
/// <summary>
|
||
/// 获取未读邮件数量(GET,无参)
|
||
/// 返回:long(未读数量)
|
||
/// </summary>
|
||
public static void GetUser(string userID,Action<UserData> callback)
|
||
{
|
||
APIManager.Response<UserData>(APIType.User_GetUser,new GetUserParam
|
||
{
|
||
userid=userID
|
||
}, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新头像(GET)
|
||
/// 参数:avatarUrl(头像地址或ID)
|
||
/// </summary>
|
||
public static void UpdateAvatar(string avatarUrl, Action<string> callback = null)
|
||
{
|
||
APIManager.Response<string>(APIType.User_UpdateAvatar, new UpdateAvatarParam
|
||
{
|
||
avatarUrl = avatarUrl
|
||
}, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新头像框(GET)
|
||
/// Swagger: /api/User/UpdateAvatarFrame?avatarFrame=xxx
|
||
/// </summary>
|
||
public static void UpdateAvatarFrame(string avatarFrame, Action<string> callback = null)
|
||
{
|
||
APIManager.Response<string>(APIType.User_UpdateAvatarFrame, new UpdateAvatarFrameParam
|
||
{
|
||
avatarFrame = avatarFrame
|
||
}, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 修改名称(GET)
|
||
/// Swagger: /api/User/UpdateUserName?userName=xxx
|
||
/// </summary>
|
||
public static void UpdateUserName(string userName, Action<string> callback = null)
|
||
{
|
||
APIManager.Response<string>(APIType.User_UpdateUserName, new UpdateUserNameParam
|
||
{
|
||
userName = userName
|
||
}, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定/换绑手机号(GET)
|
||
/// Swagger: /api/User/BindMobile?mobile=xxx&code=xxx
|
||
/// </summary>
|
||
public static void BindMobile(string mobile, string code, Action<string> callback = null)
|
||
{
|
||
APIManager.Response<string>(APIType.User_BindMobile, new BindMobileParam
|
||
{
|
||
mobile = mobile,
|
||
code = code
|
||
}, callback);
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Rank
|
||
|
||
/// <summary>
|
||
/// 获取排行榜(用户列表分页)(POST)
|
||
/// </summary>
|
||
public static void GetRankList(BaseListPageObj req, Action<List<UserListItemDto>> callback)
|
||
{
|
||
APIManager.Response<List<UserListItemDto>>(APIType.Rank_GetUserList, req, callback);
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Notice_公告
|
||
|
||
/// <summary>
|
||
/// 获取公告列表(POST)
|
||
/// 参数:keyWord/pageIndex/pageSize
|
||
/// 返回:List<NoticeDto>
|
||
/// </summary>
|
||
public static void GetNoticeList(NoticeListObj req, Action<List<NoticeDto>> callback)
|
||
{
|
||
APIManager.Response<List<NoticeDto>>(APIType.Notice_List, req, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取公告详情(GET)
|
||
/// 参数:公告 id
|
||
/// 返回:NoticeDto
|
||
/// </summary>
|
||
public static void GetNotice(NoticeIdParam req, Action<NoticeDto> callback)
|
||
{
|
||
APIManager.Response<NoticeDto>(APIType.Notice_Get, req, callback);
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|