Autoresponder: Изменил архитектуру юнитов

Теперь юниты хранять только MailSend, а не поля в разнабой, которые необходимо отправить пользователю
This commit is contained in:
Mark Struchkov 2019-01-27 17:15:23 +03:00
parent 04a7e180b1
commit d727e37bd8
2 changed files with 18 additions and 0 deletions

View File

@ -24,10 +24,19 @@ public class MailSanderVk implements MailSandler {
} }
if (mailSend.getKeyboard()!=null) { if (mailSend.getKeyboard()!=null) {
messages.keyboard(mailSend.getKeyboard()); messages.keyboard(mailSend.getKeyboard());
} else {
messages.keyboard("{\"buttons\":[],\"one_time\":true}");
} }
if (mailSend.getLat()!=null && mailSend.getaLong()!=null) { if (mailSend.getLat()!=null && mailSend.getaLong()!=null) {
messages.lat(mailSend.getLat()).lng(mailSend.getaLong()); messages.lat(mailSend.getLat()).lng(mailSend.getaLong());
} }
if (mailSend.getStickerId()!=null) {
try {
vkApiClient.messages().send(groupActor).peerId(mailSend.getIdRecipient()).stickerId(mailSend.getStickerId()).execute();
} catch (ApiException | ClientException e) {
e.printStackTrace();
}
}
try { try {
messages.execute(); messages.execute();

View File

@ -7,6 +7,7 @@ public class MailSend {
private Integer idRecipient; private Integer idRecipient;
private Float lat; private Float lat;
private Float aLong; private Float aLong;
private Integer stickerId;
public MailSend() { public MailSend() {
@ -51,4 +52,12 @@ public class MailSend {
public void setaLong(Float aLong) { public void setaLong(Float aLong) {
this.aLong = aLong; this.aLong = aLong;
} }
public Integer getStickerId() {
return stickerId;
}
public void setStickerId(Integer stickerId) {
this.stickerId = stickerId;
}
} }