封禁记录查询
查询账户封禁原因的 API。
API 信息
- URL:
https://service-account.playnanoo.com/api/v20221201/reason - Method:
PUT - 需要认证: 是
请求参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| platform | string | 必需 | 平台(例如:"aos"、"ios") |
| device_id | string | ��需 | 设备唯一 ID |
| device_model | string | 必需 | 设备���号 |
| device_os | string | 必需 | 设备 OS |
| device_language | string | 必需 | 设备语言(例如:"KO"、"EN") |
响应数据
Items 数组
每个封禁项目包含以下信息:
userId:用户 IDReason:封禁原因Permanent:是否永久封禁ExpireDate:封禁到期日(非永久封禁时)
Unity C# 实现
BaseResponse 类
所有 API 响应的基类。
public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}
字段说明:
ErrorCode:错误代码Message:错误信息WithdrawalKey���处于注销宽限期时恢复所需的密钥(仅在注销宽��期内的账户提供)BlockKey:被封禁账户时��供的密钥(仅在���封禁的账��提供)
封禁原因查��类
using System;
using System.Collections;
using UnityEngine.Networking;
public class Reason
{
static string path = "https://service-api.playnanoo.com/block/v20221201/reason";
[Serializable]
public class Req : DeviceInfo
{
public string block_key;
public IEnumerator Send(string block_key, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(block_key)) this.block_key = block_key;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: false,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public SerializeItems[] Items;
}
[Serializable]
public class SerializeItems
{
public string userId;
public string Reason;
public string Permanent;
public string ExpireDate;
public string TimeUntilExpire;
public string[] Services;
}
}
使用示例
public void GetBlockReason()
{
Reason.Req req = new Reason.Req();
StartCoroutine(req.Send(
block_key: "차단시_받은_block_key",
onSuccess: res =>
{
if (res.Items != null && res.Items.Length > 0)
{
foreach (var item in res.Items)
{
Debug.Log($"사용자 ID: {item.userId}");
Debug.Log($"차단 사유: {item.Reason}");
Debug.Log($"영구 차단: {item.Permanent}");
Debug.Log($"남은 시간: {item.TimeUntilExpire}");
if (item.Permanent != "Y")
{
Debug.Log($"차단 만료일: {item.ExpireDate}");
}
}
}
else
{
Debug.Log("차단 내역이 없습니다.");
}
},
onError: (error) =>
{
Debug.LogError($"차단 사유 조회 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
封禁类型
- 临时封禁:
Permanent为 "N" 且设置了ExpireDate的情况。仅在指定日期之前封禁。 - 永久封禁:
Permanent为 "Y" 的情况。在解除之前将持续封禁。
被封禁的账户
此 API 用于查看被封禁账户的封禁原因。当登录尝试时出现封禁错误时,可以调用此 API 向用户显示详细的封禁信息。