Сокращены названия JSON-параметров

This commit is contained in:
Victor 2014-01-10 17:17:53 +02:00
parent 8c18983280
commit 78914c2f17

View File

@ -57,10 +57,10 @@ public class ApiUtils {
for (int i = 0; i < jsonArray.length(); i++) { for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
ForumPost post = new ForumPost(); ForumPost post = new ForumPost();
post.setTopicId(jsonObject.getInt("topic_id")); post.setTopicId(jsonObject.getInt("topic"));
post.setTopicTitle(jsonObject.getString("title")); post.setTopicTitle(jsonObject.getString("title"));
post.setDate(jsonObject.getInt("time")); post.setDate(jsonObject.getInt("time"));
post.setAuthor(jsonObject.getString("username")); post.setAuthor(jsonObject.getString("user"));
post.setMessage(jsonObject.getString("text")); post.setMessage(jsonObject.getString("text"));
posts.add(post); posts.add(post);
} }
@ -93,7 +93,7 @@ public class ApiUtils {
for (int i = 0; i < jsonArray.length(); i++) { for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
ForumTopic post = new ForumTopic(); ForumTopic post = new ForumTopic();
post.setId(jsonObject.getInt("topic_id")); post.setId(jsonObject.getInt("topic"));
post.setTitle(jsonObject.getString("title")); post.setTitle(jsonObject.getString("title"));
post.setCreationDate(jsonObject.getInt("time")); post.setCreationDate(jsonObject.getInt("time"));
topics.add(post); topics.add(post);