길드 정보 수정
길드 정보를 수정하는 API입니다.
URL 확인
이 API는 service-api.playnanoo.com 도메인을 사용합니다.
API 정보
- URL:
https://service-api.playnanoo.com/guild/v20230101/edit - Method:
PUT - 인증 필요: 예
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| table_code | string | 필수 | 테이블 코드 |
| uid | string | 필수 | 길드 고유 ID |
| name | string | 필수 | 길드 이름 |
| member_limit | int | 필수 | 멤버 제한 수 |
| member_point_type | string | 필수 | 멤버 포인트 타입 (keep: 포인트유지, delete: 포인트차감) |
| auto_join | string | 필수 | 자동 가입 여부 (Y/N) |
| extra_data | string | 필수 | 추가 데이터 |
DeviceInfo 상속
이 API의 Req 클래스는 DeviceInfo를 상속받습니다. DeviceInfo의 모든 속성이 자동으로 포함됩니다.
응답 데이터
Res 클래스
| 필드 | 타입 | 설명 |
|---|---|---|
| Status | string | 처리 상태 |
Unity C# 구현
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class GuildEdit
{
static string path = "https://service-api.playnanoo.com/guild/v20230101/edit";
[Serializable]
public class Req : DeviceInfo
{
public string table_code;
public string uid;
public string name;
public int member_limit;
public string member_point_type; //길드원 탈퇴시 keep : 포인트유지, delete : 포인트차감
public string auto_join;
public string extra_data;
public IEnumerator Send(
string tableCode,
string uid,
string name,
int memberLimit,
string memberPointType,
bool autoJoin,
string extraData,
Action<Res> onSuccess,
Action<BaseResponse> onError
)
{
if (!string.IsNullOrEmpty(tableCode)) this.table_code = tableCode;
if (!string.IsNullOrEmpty(uid)) this.uid = uid;
if (!string.IsNullOrEmpty(name)) this.name = name;
if (!string.IsNullOrEmpty(memberPointType)) this.member_point_type = memberPointType;
if (!string.IsNullOrEmpty(extraData)) this.extra_data = extraData;
this.auto_join = autoJoin ? "Y" : "N";
this.member_limit = memberLimit;
yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}
[Serializable]
public class Res : BaseResponse
{
public string Status;
}
}
사용 예제
public void EditGuild()
{
GuildEdit.Req req = new GuildEdit.Req();
StartCoroutine(req.Send(
tableCode: "guild_table",
uid: "guild_uid",
name: "UpdatedGuildName",
memberLimit: 50,
memberPointType: "keep",
autoJoin: false,
extraData: "",
onSuccess: res =>
{
Debug.Log($"Status: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"길드 수정 실패: [{error.ErrorCode}] {error.Message}");
}
));
}