aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-28 15:25:11 +0300
committerGravatar Vitaly Takmazov2016-11-28 15:25:11 +0300
commit595775d273a6af92268426e9f66e39082e389aa9 (patch)
tree6adf966f58431148840b35dc48b5f1b08e6b3fb4 /juick-www
parentb4225fa075eef58924399f2c5f7a117ee171c2c6 (diff)
fix vk users.get deserialization
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/src/main/java/com/juick/www/VKontakteLogin.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/vk/GraphResponse.java19
-rw-r--r--juick-www/src/main/java/com/juick/www/vk/UsersResponse.java21
3 files changed, 22 insertions, 20 deletions
diff --git a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java
index 1ccf36b6..55dfd202 100644
--- a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java
+++ b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java
@@ -88,7 +88,7 @@ public class VKontakteLogin {
}
try {
- com.juick.www.vk.User jsonUser = mapper.readValue(graph, GraphResponse.class).getUser();
+ com.juick.www.vk.User jsonUser = mapper.readValue(graph, UsersResponse.class).getUsers().get(0);
String vkName = jsonUser.getFirstName() + " " + jsonUser.getLastName();
String vkLink = jsonUser.getScreenName();
diff --git a/juick-www/src/main/java/com/juick/www/vk/GraphResponse.java b/juick-www/src/main/java/com/juick/www/vk/GraphResponse.java
deleted file mode 100644
index f1985a91..00000000
--- a/juick-www/src/main/java/com/juick/www/vk/GraphResponse.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.juick.www.vk;
-
-import com.fasterxml.jackson.annotation.JsonValue;
-
-/**
- * Created by vitalyster on 28.11.2016.
- */
-public class GraphResponse {
- private User user;
-
- @JsonValue
- public User getUser() {
- return user;
- }
-
- public void setUser(User user) {
- this.user = user;
- }
-}
diff --git a/juick-www/src/main/java/com/juick/www/vk/UsersResponse.java b/juick-www/src/main/java/com/juick/www/vk/UsersResponse.java
new file mode 100644
index 00000000..d77aa481
--- /dev/null
+++ b/juick-www/src/main/java/com/juick/www/vk/UsersResponse.java
@@ -0,0 +1,21 @@
+package com.juick.www.vk;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by vitalyster on 28.11.2016.
+ */
+public class UsersResponse {
+ private List<User> users;
+
+ @JsonProperty("response")
+ public List<User> getUsers() {
+ return users;
+ }
+
+ public void setUsers(List<User> users) {
+ this.users = users;
+ }
+}