aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
+ }
+}