GetAllTableList
public BackndReturnObject GetAllTableList();
Description
The information of all tables is retrieved.
Example
Synchronous
Backnd.PlayerTable.GetAllTableList();
Asynchronous
Backnd.PlayerTable.GetAllTableList((callback) =>
{
// Post-process
});
Return cases
Success cases
When loaded successfully
statusCode : 200
returnValue : refer to GetReturnValuetoJSON
GetReturnValuetoJSON
{
// Server time when the request was processed
"serverTime":"2021-02-01T05:19:56.853Z",
"tables":
[
{
"tableName":"tableName", // Table name
"tableExplaination":"Table description", // Table description
"isChecked":true, // Status of activation(can be turned on/off by clicking the console's Table Management)
"hasSchema":false // Existence of schema
},
{
"tableName":"tableName2", // Table name
"tableExplaination":"Table description 2", // Table description
"isChecked":true, // Status of activation(can be turned on/off by clicking the console's Table Management)
"hasSchema":false // Existence of schema
},
...
]
}
Sample code
public class TableItem
{
public string tableName;
public string tableExplaination;
public bool isChecked;
public bool hasSchema;
public override string ToString()
{
return $"tableName : {tableName}\n" +
$"tableExplaination : {tableExplaination}\n" +
$"isChecked : {isChecked}\n" +
$"hasSchema : {hasSchema}\n";
}
}
public void GetAllTableList()
{
var bro = Backnd.PlayerTable.GetAllTableList();
if(!bro.IsSuccess())
{
Debug.LogError(bro.ToString());
return;
}
List<TableItem> tableList = new List<TableItem>();
BACKND.LitJson.JsonData tableListJson = bro.GetReturnValuetoJSON()["tables"];
for(int i = 0; i < tableListJson.Count; i++)
{
TableItem tableItem = new TableItem();
tableItem.tableName = tableListJson[i]["tableName"].ToString();
tableItem.tableExplaination = tableListJson[i]["tableExplaination"].ToString();
tableItem.isChecked = tableListJson[i]["isChecked"].ToString() == "true" ? true : false;
tableItem.hasSchema = tableListJson[i]["hasSchema"].ToString() == "true" ? true : false;
tableList.Add(tableItem);
Debug.Log(tableItem.ToString());
}
}