본문으로 건너뛰기

길드 정보 수정

길드 정보를 수정하는 API입니다.

URL 확인

이 API는 service-api.playnanoo.com 도메인을 사용합니다.

API 정보

  • URL: https://service-api.playnanoo.com/guild/v20230101/edit
  • Method: PUT
  • 인증 필요: 예

요청 파라미터

파라미터타입필수설명
table_codestring필수테이블 코드
uidstring필수길드 고유 ID
namestring필수길드 이름
member_limitint필수멤버 제한 수
member_point_typestring필수멤버 포인트 타입 (keep: 포인트유지, delete: 포인트차감)
auto_joinstring필수자동 가입 여부 (Y/N)
extra_datastring필수추가 데이터
DeviceInfo 상속

이 API의 Req 클래스는 DeviceInfo를 상속받습니다. DeviceInfo의 모든 속성이 자동으로 포함됩니다.

응답 데이터

Res 클래스

필드타입설명
Statusstring처리 상태

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}");
}
));
}