123 lines
4.2 KiB
C#
123 lines
4.2 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.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);
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Notice_公告
|
||
|
||
/// <summary>
|
||
/// 获取公告列表(POST)
|
||
/// 返回:List<GetEmailByPageResponse>
|
||
/// </summary>
|
||
public static void GetNoticeList(Action<List<GetEmailByPageResponse>> callback)
|
||
{
|
||
//APIManager.Response<List<GetEmailByPageResponse>>(APIType.Notice_List, new { }, callback);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取公告详情,未读自动变为已读(GET)
|
||
/// 参数:公告 id
|
||
/// 返回:GetEmailByPageResponse
|
||
/// </summary>
|
||
public static void GetNotice(GetEmailParam req, Action<GetEmailByPageResponse> callback)
|
||
{
|
||
APIManager.Response<GetEmailByPageResponse>(APIType.Notice_Get, req, callback);
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|