Merge branch 'bugfix/answer-save-action' into develop
Some checks failed
continuous-integration/drone/push Build is failing

# Conflicts:
#	bot-context/bot-context-main/pom.xml
#	bot-context/bot-context-quarkus/pom.xml
#	bot-context/bot-context-simple/pom.xml
#	bot-context/pom.xml
#	bot-core/bot-core-main/pom.xml
#	bot-core/bot-core-quarkus/pom.xml
#	bot-core/bot-core-simple/pom.xml
#	bot-core/pom.xml
#	bot-data/bot-data-main/pom.xml
#	bot-data/bot-data-quarkus/pom.xml
#	bot-data/bot-data-simple/pom.xml
#	bot-data/pom.xml
#	bot-domain/bot-domain-main/pom.xml
#	bot-domain/bot-domain-quarkus/pom.xml
#	bot-domain/bot-domain-simple/pom.xml
#	bot-domain/pom.xml
#	bot-exception/pom.xml
#	pom.xml
This commit is contained in:
Struchkov Mark 2023-05-23 16:38:36 +03:00
commit 9c4db3ff7a
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
19 changed files with 27 additions and 25 deletions

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-context</artifactId> <artifactId>bot-context</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-context-main</artifactId> <artifactId>bot-context-main</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-context</artifactId> <artifactId>bot-context</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-context-quarkus</artifactId> <artifactId>bot-context-quarkus</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-context</artifactId> <artifactId>bot-context</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-context-simple</artifactId> <artifactId>bot-context-simple</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-context</artifactId> <artifactId>bot-context</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-core</artifactId> <artifactId>bot-core</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-core-main</artifactId> <artifactId>bot-core-main</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-core</artifactId> <artifactId>bot-core</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-core-quarkus</artifactId> <artifactId>bot-core-quarkus</artifactId>

View File

@ -24,28 +24,30 @@ public class AnswerSaveAction<D> implements ActionUnit<AnswerSave<Message, D>, M
final AnswerSave<Message, D> answerSave = unitRequest.getUnit(); final AnswerSave<Message, D> answerSave = unitRequest.getUnit();
final Message message = unitRequest.getMessage(); final Message message = unitRequest.getMessage();
final AnswerSavePreservable<D> preservable = answerSave.getPreservable();
final String personId = message.getFromPersonId();
final CheckSave<Message> checkSave = answerSave.getCheckSave(); final CheckSave<Message> checkSave = answerSave.getCheckSave();
if (checkNotNull(checkSave)) { if (checkNotNull(checkSave)) {
return Uni.createFrom().voidItem() return Uni.createFrom().voidItem()
.onItem().transformToUni( .onItem().transformToUni(
v -> checkSave.check(message) v -> checkSave.check(message)
.onItem().transform( .onItem().ifNotNull().transformToUni(
unit -> { unit -> {
if (checkNotNull(unit)) { if (checkNotNull(unit)) {
return UnitRequest.of(unit, message); return Uni.createFrom().item(UnitRequest.of(unit, message));
} }
return UnitRequest.of(answerSave, message); return getUnitRequestUni(answerSave, message);
} }
) )
); );
} }
return getUnitRequestUni(answerSave, message);
}
private Uni<UnitRequest<MainUnit, Message>> getUnitRequestUni(AnswerSave<Message, D> answerSave, Message message) {
final String personId = message.getFromPersonId();
final AnswerSavePreservable<D> preservable = answerSave.getPreservable();
final PreservableData<D, Message> preservableData = answerSave.getPreservableData(); final PreservableData<D, Message> preservableData = answerSave.getPreservableData();
final Pusher<D> pusher = answerSave.getPusher(); final Pusher<D> pusher = answerSave.getPusher();
return Uni.createFrom().voidItem() return Uni.createFrom().voidItem()
.onItem().transformToUni( .onItem().transformToUni(
v -> { v -> {

View File

@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>bot-core</artifactId> <artifactId>bot-core</artifactId>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-core-simple</artifactId> <artifactId>bot-core-simple</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-core</artifactId> <artifactId>bot-core</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>bot-data</artifactId> <artifactId>bot-data</artifactId>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-data-main</artifactId> <artifactId>bot-data-main</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-data</artifactId> <artifactId>bot-data</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-data-quarkus</artifactId> <artifactId>bot-data-quarkus</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-data</artifactId> <artifactId>bot-data</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-data-simple</artifactId> <artifactId>bot-data-simple</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-data</artifactId> <artifactId>bot-data</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>bot-domain</artifactId> <artifactId>bot-domain</artifactId>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-domain-main</artifactId> <artifactId>bot-domain-main</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-domain</artifactId> <artifactId>bot-domain</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-domain-quarkus</artifactId> <artifactId>bot-domain-quarkus</artifactId>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>bot-domain</artifactId> <artifactId>bot-domain</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-domain-simple</artifactId> <artifactId>bot-domain-simple</artifactId>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -4,7 +4,7 @@
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.68-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>