Skip to main content
Version: 5.11.8

GetQuestionOne

public BackendReturnObject GetQuestionOne(string inDate);

Description

A specific list of inquiries you sent is loaded.
When an answer is provided, answerDate and answer columns are added, and the flag changes to Answered.

Example

Synchronous

var bro = Backend.Question.GetQuestionOne("2023-04-07T02:03:34.707Z");

Asynchronous

Backend.Question.GetQuestionOne("2023-04-07T02:03:34.707Z", callback => {

});

SendQueue

SendQueue.Enqueue(Backend.Question.GetQuestionOne, "2023-04-07T02:03:34.707Z", callback => {

});

Return cases

Success cases

When loaded successfully
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

When the registered inquiry does not exist
statusCode : 200

returnValue : {"rows":[]}

GetReturnValuetoJSON

{
"row":
{
"content": "This game could use competitive content to make it more fun to play.",
"answer": "Here is the answer.",
"flag": "Answered",
"nickname": "a0",
"inDate": "2023-04-10T07:28:09.591Z",
"images": [],
"type": "Suggestions",
"answerDate": "2023-04-07T05:46:01.212Z",
"answer": "Here is the answer.",
"title": "Please add a ranking function"
}
}

Example Code

class QuestionData {
public DateTime answerDate;
public string content;
public string flag;
public string nickname;
public string inDate;
public string answer;
public string title;
public string type;
public override string ToString() {
return $"answerDate : {answerDate}\n" +
$"content : {content}\n" +
$"flag : {flag}\n" +
$"nickname : {nickname}\n" +
$"inDate : {inDate}\n" +
$"answer : {answer}\n" +
$"title : {title}\n" +
$"type : {type}\n"
;
}
}
string inDate = Backend.Question.GetQuestionList().Rows()[0]["inDate"].ToString();

LitJson.JsonData jsonData = Backend.Question.GetQuestionOne(inDate).GetFlattenJSON()["row"];

QuestionData questionData = new QuestionData();

if(jsonData.ContainsKey("answerDate")) {
questionData.answerDate = DateTime.Parse(jsonData["answerDate"].ToString());
}

questionData.content = jsonData["content"].ToString();
questionData.flag = jsonData["flag"].ToString();
questionData.nickname = jsonData["nickname"].ToString();
questionData.inDate = jsonData["inDate"].ToString();
questionData.title = jsonData["title"].ToString();
questionData.type = jsonData["type"].ToString();

if(jsonData.ContainsKey("answer")) {
questionData.answer = jsonData["answer"].ToString();
}

Debug.Log(questionData.ToString());