Autoresponder: Изменил архитектуру юнитов
Теперь юниты хранять только MailSend, а не поля в разнабой, которые необходимо отправить пользователю
This commit is contained in:
parent
04a7e180b1
commit
d727e37bd8
@ -24,10 +24,19 @@ public class MailSanderVk implements MailSandler {
|
||||
}
|
||||
if (mailSend.getKeyboard()!=null) {
|
||||
messages.keyboard(mailSend.getKeyboard());
|
||||
} else {
|
||||
messages.keyboard("{\"buttons\":[],\"one_time\":true}");
|
||||
}
|
||||
if (mailSend.getLat()!=null && mailSend.getaLong()!=null) {
|
||||
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 {
|
||||
messages.execute();
|
||||
|
@ -7,6 +7,7 @@ public class MailSend {
|
||||
private Integer idRecipient;
|
||||
private Float lat;
|
||||
private Float aLong;
|
||||
private Integer stickerId;
|
||||
|
||||
public MailSend() {
|
||||
|
||||
@ -51,4 +52,12 @@ public class MailSend {
|
||||
public void setaLong(Float aLong) {
|
||||
this.aLong = aLong;
|
||||
}
|
||||
|
||||
public Integer getStickerId() {
|
||||
return stickerId;
|
||||
}
|
||||
|
||||
public void setStickerId(Integer stickerId) {
|
||||
this.stickerId = stickerId;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user