diff --git a/pom.xml b/pom.xml
index 185e3c8..7103068 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
2.8.5
0.5.13-SNAPSHOT
- 1.2.17
+ 1.7.26
@@ -43,9 +43,9 @@
${gson.ver}
- log4j
- log4j
- ${log4j.ver}
+ org.slf4j
+ slf4j-api
+ ${slf4j.ver}
diff --git a/src/main/java/org/sadtech/bot/core/domain/BoxAnswer.java b/src/main/java/org/sadtech/bot/core/domain/BoxAnswer.java
index e944b40..9248802 100644
--- a/src/main/java/org/sadtech/bot/core/domain/BoxAnswer.java
+++ b/src/main/java/org/sadtech/bot/core/domain/BoxAnswer.java
@@ -14,7 +14,7 @@ public class BoxAnswer {
}
- public BoxAnswer(BoxAnswer target) {
+ private BoxAnswer(BoxAnswer target) {
if (target != null) {
this.message = target.getMessage();
this.keyboard = target.getKeyboard();
@@ -69,6 +69,45 @@ public class BoxAnswer {
return new BoxAnswer(this);
}
+ public static Builder builder() {
+ return new BoxAnswer().new Builder();
+ }
+
+ public class Builder {
+ private Builder() {
+
+ }
+
+ public Builder message(String message) {
+ BoxAnswer.this.message = message;
+ return this;
+ }
+
+ public Builder keyBoard(String keyBoard) {
+ BoxAnswer.this.keyboard = keyBoard;
+ return this;
+ }
+
+ public Builder lat(Float lat) {
+ BoxAnswer.this.lat = lat;
+ return this;
+ }
+
+ public Builder aLong(Float aLong) {
+ BoxAnswer.this.aLong = aLong;
+ return this;
+ }
+
+ public Builder steckerId(Integer stickerId) {
+ BoxAnswer.this.stickerId = stickerId;
+ return this;
+ }
+
+ public BoxAnswer build() {
+ return BoxAnswer.this;
+ }
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
diff --git a/src/main/java/org/sadtech/bot/core/domain/MailSend.java b/src/main/java/org/sadtech/bot/core/domain/MailSend.java
deleted file mode 100644
index 8238818..0000000
--- a/src/main/java/org/sadtech/bot/core/domain/MailSend.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.sadtech.bot.core.domain;
-
-public class MailSend {
-
- private String message;
- private String keyboard;
- private Float lat;
- private Float aLong;
- private Integer stickerId;
-
- public MailSend() {
-
- }
-
- public String getKeyboard() {
- return keyboard;
- }
-
- public void setKeyboard(String keyboard) {
- this.keyboard = keyboard;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public Float getLat() {
- return lat;
- }
-
- public void setLat(Float lat) {
- this.lat = lat;
- }
-
- public Float getaLong() {
- return aLong;
- }
-
- public void setaLong(Float aLong) {
- this.aLong = aLong;
- }
-
- public Integer getStickerId() {
- return stickerId;
- }
-
- public void setStickerId(Integer stickerId) {
- this.stickerId = stickerId;
- }
-
- @Override
- public String toString() {
- return "MailSend{" +
- "message='" + message + '\'' +
- ", keyboard='" + keyboard + '\'' +
- ", lat=" + lat +
- ", aLong=" + aLong +
- ", stickerId=" + stickerId +
- '}';
- }
-
-}
diff --git a/src/main/java/org/sadtech/bot/core/sender/Sent.java b/src/main/java/org/sadtech/bot/core/sender/Sent.java
index 63a33ba..120e56c 100644
--- a/src/main/java/org/sadtech/bot/core/sender/Sent.java
+++ b/src/main/java/org/sadtech/bot/core/sender/Sent.java
@@ -4,8 +4,8 @@ import org.sadtech.bot.core.domain.BoxAnswer;
public interface Sent {
- void send(Integer idPerson, String message);
+ void send(Integer personId, String message);
- void send(Integer idPerson, BoxAnswer boxAnswer);
+ void send(Integer personId, BoxAnswer boxAnswer);
}
diff --git a/src/main/java/org/sadtech/bot/core/service/impl/RawEventServiceImpl.java b/src/main/java/org/sadtech/bot/core/service/impl/RawEventServiceImpl.java
index 7232f89..c592287 100644
--- a/src/main/java/org/sadtech/bot/core/service/impl/RawEventServiceImpl.java
+++ b/src/main/java/org/sadtech/bot/core/service/impl/RawEventServiceImpl.java
@@ -1,15 +1,16 @@
package org.sadtech.bot.core.service.impl;
import com.google.gson.JsonObject;
-import org.apache.log4j.Logger;
import org.sadtech.bot.core.repository.EventRepository;
import org.sadtech.bot.core.service.RawEventService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Queue;
public class RawEventServiceImpl implements RawEventService {
- private static final Logger log = Logger.getLogger(RawEventServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(RawEventServiceImpl.class);
private final EventRepository eventRepository;