release-0.0.34

This commit is contained in:
Struchkov Mark 2022-09-19 20:21:31 +03:00
parent 6e4837a8e7
commit 0ac055b488
22 changed files with 58 additions and 64 deletions

View File

@ -1,20 +0,0 @@
postgres:
image: 192.168.235.157:8182/postgres:13.1-alpine
container_name: theater-postgres
hostname: postgres
restart: on-failure
networks:
- network
ports:
- 5433:5432
volumes:
- ./volume/db/01-init.sh:/docker-entrypoint-initdb.d/01-init.sh
- ./volume/db/storage:/var/lib/postgresql/data:z
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- APP_DB_USER=${DATASOURCE_USERNAME}
- APP_DB_PASS=${DATASOURCE_PASSWORD}
volumes:
gitlab-notify:

11
pom.xml
View File

@ -5,7 +5,7 @@
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
<packaging>pom</packaging>
<modules>
@ -14,7 +14,7 @@
<module>telegram-domain</module>
<module>telegram-consumer</module>
<module>telegram-context</module>
<module>telegram</module>
<module>telegram-simple</module>
</modules>
<name>Telegram Bot</name>
@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<godfather.core.ver>0.0.25</godfather.core.ver>
<godfather.core.ver>0.0.27</godfather.core.ver>
<telegrambots.ver>6.1.0</telegrambots.ver>
<haiti.version>1.4.0</haiti.version>
@ -74,6 +74,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core-main</artifactId>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>telegram-bot</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,6 +4,8 @@ import dev.struchkov.godfather.main.domain.content.Mail;
import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
import org.telegram.telegrambots.meta.api.objects.User;
import java.time.LocalDateTime;
/**
* TODO: Добавить описание класса.
*
@ -13,6 +15,7 @@ public class CallbackQueryConvert {
public static Mail apply(CallbackQuery callbackQuery) {
final Mail mail = new Mail();
mail.setCreateDate(LocalDateTime.now());
mail.setText(callbackQuery.getData());
mail.setPersonId(callbackQuery.getMessage().getChatId());

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>telegram-bot</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-context</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-context</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>telegram-context</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modules>
<module>telegram-core-main</module>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>telegram-core</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -55,31 +55,32 @@ public class TelegramSender implements TelegramSending {
}
@Override
public SendType getType() {
return SendType.PRIVATE;
}
public Uni<Void> sendNotSave(@NotNull Long telegramId, @NotNull BoxAnswer boxAnswer) {
return sendBoxAnswer(telegramId, boxAnswer, false);
}
private Uni<Void> sendBoxAnswer(@NotNull Long telegramId, @NotNull BoxAnswer boxAnswer, boolean saveMessageId) {
isNotNull(telegramId, boxAnswer);
return Uni.createFrom().voidItem()
.onItem().transformToUni(
v -> {
isNotNull(telegramId, boxAnswer);
if (boxAnswer.isReplace() && checkNotNull(senderStorageService)) {
return senderStorageService.getLastSendMessage(telegramId)
.onItem().transformToUni(
lastId -> {
if (checkNotNull(lastId)) {
return replaceMessage(telegramId, lastId, boxAnswer);
} else {
return sendMessage(telegramId, boxAnswer, saveMessageId);
}
if (boxAnswer.isReplace() && checkNotNull(senderStorageService)) {
return senderStorageService.getLastSendMessage(telegramId)
.onItem().transformToUni(
lastId -> {
if (checkNotNull(lastId)) {
return replaceMessage(telegramId, lastId, boxAnswer);
} else {
return sendMessage(telegramId, boxAnswer, saveMessageId);
}
}
);
} else {
return sendMessage(telegramId, boxAnswer, saveMessageId);
}
);
} else {
return sendMessage(telegramId, boxAnswer, saveMessageId);
}
}
);
}
private Uni<Void> replaceMessage(@NotNull Long telegramId, @NotNull Integer lastMessageId, @NotNull BoxAnswer boxAnswer) {
@ -131,7 +132,12 @@ public class TelegramSender implements TelegramSending {
}
return Uni.createFrom().voidItem();
}
);
).replaceWithVoid();
}
@Override
public SendType getType() {
return SendType.PRIVATE;
}
}

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,11 +5,11 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.30</version>
<version>0.0.34</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>telegram</artifactId>
<artifactId>telegram-simple</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
@ -19,15 +19,15 @@
<dependencies>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<artifactId>telegram-core-simple</artifactId>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<artifactId>telegram-consumer-simple</artifactId>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-simple-sender</artifactId>
<artifactId>telegram-sender-simple</artifactId>
</dependency>
</dependencies>