跳转到主要内容

查询加入申请列表

查询用户已申请加入的公会列表的 API。

URL 确认

此 API 使用 service-api.playnanoo.com 域名。

API 信息

  • URL: https://service-api.playnanoo.com/guild/v20230101/personal/request/search
  • Method: PUT
  • 需要认证: 是

请求参数

参数类型必填说明
table_codestring必填表代码
DeviceInfo 继承

此 API 的 Req 类继承自 DeviceInfo。DeviceInfo 的所有属性将自动包含。

响应数据

Res 类

字段类型说明
ItemsList\<SearchItemModel>加入申请列表

SearchItemModel 结构

字段类型说明
TableCodestring表代码
Uidstring公会唯一 ID
Namestring公会名称
Pointdouble公会积分
Countrystring国家代码
MemberCountint当前成员数
MemberLimitint成员限制数
AutoJoinstring自动加入
ExtraDatastring附加数据
InDatestring公会创建日期
RequestInDatestring申请日期

Unity C# 实现

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class GuildPersonalSearch
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/personal/request/search";

[Serializable]
public class Req : DeviceInfo
{
public string table_code;

public IEnumerator Send(
string tableCode,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;

yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public List<SearchItemModel> Items;
}

[Serializable]
public class SearchItemModel
{
public string TableCode;

public string Uid;

public string Name;

public double Point;

public string Country;

public int MemberCount;

public int MemberLimit;

public string AutoJoin;

public string ExtraData;

public string InDate;

public string RequestInDate;
}
}

使用示例

public void GetMyGuildRequests()
{
GuildPersonalSearch.Req req = new GuildPersonalSearch.Req();

StartCoroutine(req.Send(
tableCode: "guild_table",
onSuccess: res =>
{
foreach (var item in res.Items)
{
Debug.Log($"Uid: {item.Uid}, Name: {item.Name}");
Debug.Log($"MemberCount: {item.MemberCount}/{item.MemberLimit}");
Debug.Log($"RequestInDate: {item.RequestInDate}");
}
},
onError: (error) =>
{
Debug.LogError($"가입 신청 목록 조회 실패: [{error.ErrorCode}] {error.Message}");
}
));
}