diff options
Diffstat (limited to 'juick-www/src/main/java')
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 1ccf36b62..55dfd202e 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 f1985a915..000000000 --- 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 000000000..d77aa481c --- /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; + } +} |