Release 0.4

CodeStyle
This commit is contained in:
Mark Struchkov 2019-02-07 18:11:44 +03:00
parent 3873aa35c3
commit f68e6b57d7
17 changed files with 23 additions and 20 deletions

View File

@ -6,7 +6,7 @@
<groupId>org.sadtech.vkbot</groupId> <groupId>org.sadtech.vkbot</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>0.4-SNAPSHOT</version> <version>0.4-RELEASE</version>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

View File

@ -68,5 +68,4 @@ public class VkApi {
return null; return null;
} }
} }

View File

@ -25,4 +25,5 @@ public class CommentSubscriber implements EventSubscribe<JsonObject> {
WallComment wallComment = gson.fromJson(object, WallComment.class); WallComment wallComment = gson.fromJson(object, WallComment.class);
log.info(wallComment); log.info(wallComment);
} }
} }

View File

@ -42,4 +42,5 @@ public class EventDistributorVK implements EventDistributable, Runnable {
public void run() { public void run() {
distribute(); distribute();
} }
} }

View File

@ -26,4 +26,5 @@ public class MailChatSubscriber implements EventSubscribe<Message> {
public void update(Message message) { public void update(Message message) {
mailService.add(message); mailService.add(message);
} }
} }

View File

@ -62,4 +62,5 @@ public class MailSend {
", stickerId=" + stickerId + ", stickerId=" + stickerId +
'}'; '}';
} }
} }

View File

@ -78,4 +78,5 @@ public class Person {
public int hashCode() { public int hashCode() {
return Objects.hash(id, firstName, lastName, sex, city); return Objects.hash(id, firstName, lastName, sex, city);
} }
} }

View File

@ -1,7 +0,0 @@
package org.sadtech.vkbot.core.insert;
public interface Insert {
String insertWords();
}

View File

@ -10,17 +10,17 @@ public class InsertWords {
private String outText; private String outText;
public void insert(List<String> words) { public void insert(List<String> words) {
Pattern pattern = Pattern.compile("\\{(\\d+)}"); // Задаем шаблон Pattern pattern = Pattern.compile("\\{(\\d+)}");
Matcher m = pattern.matcher(inText); // Инициализация Matcher Matcher m = pattern.matcher(inText);
StringBuffer result = new StringBuffer(); // Буфер для конечного значения StringBuffer result = new StringBuffer();
while (m.find()) { // Проверка на совпадение while (m.find()) {
if (Integer.parseInt(m.group(1)) < words.size()) { if (Integer.parseInt(m.group(1)) < words.size()) {
m.appendReplacement(result, words.get(Integer.parseInt(m.group(1)))); // Подставляем значение из HashMap m.appendReplacement(result, words.get(Integer.parseInt(m.group(1))));
} else { } else {
m.appendReplacement(result, m.group(0)); m.appendReplacement(result, m.group(0));
} }
} }
m.appendTail(result); // Добавить остаток строки m.appendTail(result);
outText = result.toString(); outText = result.toString();
} }

View File

@ -80,4 +80,5 @@ public class EventListenerVk implements EventListener, Runnable {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }

View File

@ -76,4 +76,5 @@ public class MailSenderVk implements MailSent {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }

View File

@ -17,4 +17,5 @@ public interface PersonService {
boolean checkPerson(Integer idPerson); boolean checkPerson(Integer idPerson);
Person createPerson(Integer userId); Person createPerson(Integer userId);
} }

View File

@ -3,8 +3,8 @@ package org.sadtech.vkbot.core.service.distribution;
import org.sadtech.vkbot.core.entity.Comment; import org.sadtech.vkbot.core.entity.Comment;
import org.sadtech.vkbot.core.service.distribution.impl.EventService; import org.sadtech.vkbot.core.service.distribution.impl.EventService;
//@TODO: Дописать класс
public interface CommentService extends EventService<Comment> { public interface CommentService extends EventService<Comment> {
} }

View File

@ -33,4 +33,5 @@ public class CommentServiceImpl implements CommentService {
public List<Comment> getLastMailByTime(Integer timeFrom, Integer timeTo) { public List<Comment> getLastMailByTime(Integer timeFrom, Integer timeTo) {
return null; return null;
} }
} }

View File

@ -72,4 +72,5 @@ public class PersonServiceImpl implements PersonService {
person.setFirstName(userMin.getFirstName()); person.setFirstName(userMin.getFirstName());
return person; return person;
} }
} }

View File

@ -43,4 +43,5 @@ public class RawEventServiceImpl implements RawEventService {
public void replacementEventRepository(EventRepository eventRepository) { public void replacementEventRepository(EventRepository eventRepository) {
this.eventRepository = eventRepository; this.eventRepository = eventRepository;
} }
} }