From 3873aa35c39f26a0eceb7896db9d157698fe3481 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Thu, 7 Feb 2019 17:56:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BE=D1=81=D0=BC?= =?UTF-8?q?=D1=8B=D1=81=D0=BB=D0=B5=D0=BD=20=D1=8E=D0=BD=D0=B8=D1=82=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь это самостоятельный юнит, который ничего не отправляет пользователю, а только сохраняет пришедшие данные --- src/main/java/org/sadtech/vkbot/core/VkApi.java | 8 +++++++- .../org/sadtech/vkbot/core/entity/Comment.java | 14 +++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sadtech/vkbot/core/VkApi.java b/src/main/java/org/sadtech/vkbot/core/VkApi.java index 7a0f84d..d868ff0 100644 --- a/src/main/java/org/sadtech/vkbot/core/VkApi.java +++ b/src/main/java/org/sadtech/vkbot/core/VkApi.java @@ -59,7 +59,13 @@ public class VkApi { } catch (ApiException | ClientException e) { e.printStackTrace(); } - return temp != null ? temp.get(0).getCity().getTitle() : null; + if (temp!=null) { + if (temp.get(0).getCity()!=null) { + log.info("Запрошен город пользователя: " + temp.get(0).getCity().getTitle()); + return temp.get(0).getCity().getTitle(); + } + } + return null; } diff --git a/src/main/java/org/sadtech/vkbot/core/entity/Comment.java b/src/main/java/org/sadtech/vkbot/core/entity/Comment.java index c536f61..dc1d7e1 100644 --- a/src/main/java/org/sadtech/vkbot/core/entity/Comment.java +++ b/src/main/java/org/sadtech/vkbot/core/entity/Comment.java @@ -1,10 +1,22 @@ package org.sadtech.vkbot.core.entity; +//@TODO: Дописать класс public class Comment { private Integer postId; - private Integer fromId; + private Person person; private String text; private Integer data; + public Comment() { + + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } }