길드 이름 검색
길드 이름으로 검색하는 API입니다.
URL 확인
이 API는 service-api.playnanoo.com 도메인을 사용합니다.
API 정보
- URL:
https://service-api.playnanoo.com/guild/v20230101/search/name - Method:
PUT - 인증 필요: 예
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| table_code | string | 필수 | 테이블 코드 |
| name | string | 필수 | 검색할 길드 이름 |
DeviceInfo 상속
이 API의 Req 클래스는 DeviceInfo를 상속받습니다. DeviceInfo의 모든 속성이 자동으로 포함됩니다.
응답 데이터
Res 클래스
| 필드 | 타입 | 설명 |
|---|---|---|
| Items | List\<SearchItemModel> | 길드 목록 |
SearchItemModel 구조
| 필드 | 타입 | 설명 |
|---|---|---|
| TableCode | string | 테이블 코드 |
| Uid | string | 길드 고유 ID |
| Name | string | 길드 이름 |
| Point | double | 길드 포인트 |
| MasterUuid | string | 마스터 UUID |
| MasterNickname | string | 마스터 닉네임 |
| Country | string | 국가 코드 |
| MemberCount | int | 현재 멤버 수 |
| MemberLimit | int | 멤버 제한 수 |
| AutoJoin | string | 자동 가입 여부 |
| ExtraData | string | 추가 데이터 |
| InDate | string | 길드 생성 일시 |
Unity C# 구현
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class GuildSearchName
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/search/name";
[Serializable]
public class Req : DeviceInfo
{
public string table_code;
public string name;
public IEnumerator Send(
string tableCode,
string name,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;
if (!string.IsNullOrEmpty(name)) this.name = name;
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 MasterUuid;
public string MasterNickname;
public string Country;
public int MemberCount;
public int MemberLimit;
public string AutoJoin;
public string ExtraData;
public string InDate;
}
}
사용 예제
public void SearchGuildByName()
{
GuildSearchName.Req req = new GuildSearchName.Req();
StartCoroutine(req.Send(
tableCode: "guild_table",
name: "MyGuild",
onSuccess: res =>
{
foreach (var item in res.Items)
{
Debug.Log($"Uid: {item.Uid}, Name: {item.Name}");
Debug.Log($"Point: {item.Point}, MemberCount: {item.MemberCount}/{item.MemberLimit}");
Debug.Log($"Master: {item.MasterNickname}");
}
},
onError: (error) =>
{
Debug.LogError($"길드 검색 실패: [{error.ErrorCode}] {error.Message}");
}
));
}