본문으로 건너뛰기
버전: SDK-5.11.7

GetChartListByFolderV2

public BackendReturnObject GetChartListByFolderV2(int folderId);

설명

특정 폴더에 존재하는 모든 차트를 조회합니다.
해당 차트는 뒤끝 콘솔의 차트 관리 항목에서 업로드하여 적용한 엑셀파일의 데이터입니다.

조회 시 차트의 명차트의 ID/UUID, 차트의 버전이 리턴되며, 차트의 데이터는 포함되어 있지 않습니다.

차트 폴더 ID 확인 방법

해당 인자값으로 사용되는 folderId는 뒤끝 콘솔에서 차트 폴더에 존재하는 ID를 통해 확인할 수 있습니다.

GetChartListByFolder와의 차이점

GetChartListByFolder 함수와 기능은 거의 동일하지만 다음과 같은 차이점이 존재합니다.

  • 파일이 적용되지 않는 차트는 리스트에서 제외
  • Json 리턴값중 old 컬럼 제거
GetChartListByFolder 마이그레이션 안내

GetChartListByFolder() 함수에서 GetChartListByFolderV2() 함수로 마이그레이션 시 다음과 같은 사항이 있는지 확인해주세요.

  • json["rows"][0]["S"]["old"].ToString()과 같이 JSON 파싱 중 old를 사용하는가.

  • 파일 적용이 되지 않은 차트에 대한 처리가 존재하는가.

Example

동기

int folderId = 0;
Backend.Chart.GetChartListByFolderV2(folderId);

비동기

int folderId = 0;

Backend.Chart.GetChartListByFolderV2(folderId, (callback) => {
// 이후 작업
});

SendQueue

int folderId = 000;

SendQueue.Enqueue(Backend.Chart.GetChartListByFolderV2, folderId, (callback) => {
// 이후 작업
});

ReturnCase

Success cases

조회에 성공한 경우
statusCode : 200
message : Success
returnValue : GetReturnValuetoJSON 참조

Error cases

잘못된 폴더 Id를 입력하였을 경우
statusCode : 404
errorCode : NotFoundException
message : Chart folder({입력한 Folder ID}) not found, Chart folder({입력한 Folder ID})을(를) 찾을 수 없습니다

폴더에 차트가 존재하지 않는 경우
statusCode : 404
errorCode : NotFoundException
message : Chart list not found, Chart list을(를) 찾을 수 없습니다

GetReturnValuetoJSON

{
rows:
[
{
// 차트명
chartName: { S: "몬스터 차트" },
// 차트 설명
chartExplain: { NULL: true },
// 적용된 차트 파일 id
selectedChartFileId: { N: "47" },
},
{
chartName: { S: "ItemChart" },
chartExplain: { S: "아이템 정보에 대한 차트입니다." },
selectedChartFileId: { N: "47333" },
}
]
}

Sample Code

public class ChartCardV2 {
public string chartName; // 차트이름
public string chartExplain; // 차트 설명
public int selectedChartFileId;// 차트 파일 아이디

public override string ToString() {
return $"chartName: {chartName}\n" +
$"chartExplain: {chartExplain}\n" +
$"selectedChartFileId: {selectedChartFileId}\n";
}
}
public void GetChartListByFolderV2Test() {
int folderId = 343;

var bro = Backend.Chart.GetChartListByFolderV2(folderId);

if(!bro.IsSuccess()) {
Debug.LogError("에러가 발생했습니다 : " + bro.ToString());
return;
}

List<ChartCardV2> chartCardList = new List<ChartCardV2>();

LitJson.JsonData json = bro.FlattenRows();
for(int i = 0; i < json.Count; i++) {

ChartCardV2 chartCard = new ChartCardV2();
chartCard.chartName = json[i]["chartName"].ToString();
chartCard.chartExplain = json[i]["chartExplain"].ToString();
chartCard.selectedChartFileId= json[i]["selectedChartFileId"].ToString();

chartCardList.Add(chartCard);
}
foreach(var chartCard in chartCardList) {
Debug.Log(chartCard.ToString() + "\n");
}
}