From 59e4bcd2732ede37de2884e4e7ef612bab9294b9 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Mon, 14 Jan 2019 15:35:53 +0300 Subject: [PATCH 1/2] Release 1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Первый релиз. Возможности 1) Автоматический ответ на выбор по ключевым словам пользователя 2) Вставка слов в ответ от пользоваетля 3) Добавление пользователя, если его не было 4) Формирование меню --- pom.xml | 2 +- .../{PersonRepositoryImpl.java => PersonRepositoryMap.java} | 0 .../impl/{UnitRepositoryImpl.java => UnitRepositoryMap.java} | 0 .../java/org/sadtech/autoresponder/service/PersonService.java | 2 ++ .../java/org/sadtech/autoresponder/service/UnitService.java | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) rename src/main/java/org/sadtech/autoresponder/repository/impl/{PersonRepositoryImpl.java => PersonRepositoryMap.java} (100%) rename src/main/java/org/sadtech/autoresponder/repository/impl/{UnitRepositoryImpl.java => UnitRepositoryMap.java} (100%) diff --git a/pom.xml b/pom.xml index 5473141..0763275 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder core - 0.1-SNAPSHOT + 1.0 diff --git a/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryImpl.java b/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java similarity index 100% rename from src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryImpl.java rename to src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java diff --git a/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryImpl.java b/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java similarity index 100% rename from src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryImpl.java rename to src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java diff --git a/src/main/java/org/sadtech/autoresponder/service/PersonService.java b/src/main/java/org/sadtech/autoresponder/service/PersonService.java index da46400..ae963e4 100644 --- a/src/main/java/org/sadtech/autoresponder/service/PersonService.java +++ b/src/main/java/org/sadtech/autoresponder/service/PersonService.java @@ -5,7 +5,9 @@ import org.sadtech.autoresponder.entity.Person; public interface PersonService { Person getPersonById(Integer integer); + void addPerson(Person person); + boolean checkPerson(Integer idPerson); } diff --git a/src/main/java/org/sadtech/autoresponder/service/UnitService.java b/src/main/java/org/sadtech/autoresponder/service/UnitService.java index 42e6c4f..c319e0e 100644 --- a/src/main/java/org/sadtech/autoresponder/service/UnitService.java +++ b/src/main/java/org/sadtech/autoresponder/service/UnitService.java @@ -3,6 +3,7 @@ package org.sadtech.autoresponder.service; import org.sadtech.autoresponder.entity.Unit; public interface UnitService { + Unit nextUnit(Unit unit, String message); Unit getUnitById(Integer idUnit); From 534bc12c8c3caf0fc2efe0355e8f79360fd26410 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Mon, 14 Jan 2019 15:36:07 +0300 Subject: [PATCH 2/2] Rename Impl --- .../repository/impl/PersonRepositoryMap.java | 2 +- .../repository/impl/UnitRepositoryMap.java | 2 +- .../org/sadtech/autoresponder/AutoresponderTest.java | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java b/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java index 8e48c26..d831350 100644 --- a/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java +++ b/src/main/java/org/sadtech/autoresponder/repository/impl/PersonRepositoryMap.java @@ -5,7 +5,7 @@ import org.sadtech.autoresponder.repository.PersonRepository; import java.util.*; -public class PersonRepositoryImpl implements PersonRepository { +public class PersonRepositoryMap implements PersonRepository { private Map people = new HashMap<>(); diff --git a/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java b/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java index a9c58e0..7ed7c7e 100644 --- a/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java +++ b/src/main/java/org/sadtech/autoresponder/repository/impl/UnitRepositoryMap.java @@ -5,7 +5,7 @@ import org.sadtech.autoresponder.repository.UnitRepository; import java.util.*; -public class UnitRepositoryImpl implements UnitRepository { +public class UnitRepositoryMap implements UnitRepository { private Map units = new HashMap<>(); diff --git a/src/test/java/org/sadtech/autoresponder/AutoresponderTest.java b/src/test/java/org/sadtech/autoresponder/AutoresponderTest.java index 81ec996..7d79844 100644 --- a/src/test/java/org/sadtech/autoresponder/AutoresponderTest.java +++ b/src/test/java/org/sadtech/autoresponder/AutoresponderTest.java @@ -2,20 +2,17 @@ package org.sadtech.autoresponder; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.sadtech.autoresponder.entity.Person; import org.sadtech.autoresponder.entity.Unit; -import org.sadtech.autoresponder.repository.impl.PersonRepositoryImpl; -import org.sadtech.autoresponder.repository.impl.UnitRepositoryImpl; +import org.sadtech.autoresponder.repository.impl.PersonRepositoryMap; +import org.sadtech.autoresponder.repository.impl.UnitRepositoryMap; import org.sadtech.autoresponder.service.impl.PersonServiceImpl; import org.sadtech.autoresponder.service.impl.UnitServiceImpl; import java.util.ArrayList; import java.util.HashSet; -import static org.junit.Assert.*; - public class AutoresponderTest { private Person person = new Person(); @@ -23,8 +20,8 @@ public class AutoresponderTest { private Unit unit2 = new Unit(); private Unit unit3 = new Unit(); private ArrayList units = new ArrayList<>(); - private UnitRepositoryImpl unitRepository = new UnitRepositoryImpl(); - private PersonRepositoryImpl personRepository = new PersonRepositoryImpl(); + private UnitRepositoryMap unitRepository = new UnitRepositoryMap(); + private PersonRepositoryMap personRepository = new PersonRepositoryMap(); private UnitServiceImpl unitService = new UnitServiceImpl(unitRepository); private PersonServiceImpl personService = new PersonServiceImpl(personRepository);