diff --git a/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineRepository.java b/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineHistoryRepository.java similarity index 91% rename from bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineRepository.java rename to bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineHistoryRepository.java index 34b2857..07f9506 100644 --- a/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineRepository.java +++ b/bot-context/bot-context-quarkus/src/main/java/dev/struchkov/godfather/quarkus/context/repository/StorylineHistoryRepository.java @@ -4,7 +4,7 @@ import dev.struchkov.godfather.main.domain.StorylineHistory; import io.smallrye.mutiny.Uni; import org.jetbrains.annotations.NotNull; -public interface StorylineRepository { +public interface StorylineHistoryRepository { Uni save(@NotNull StorylineHistory storylineHistory); diff --git a/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineRepository.java b/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineHistoryRepository.java similarity index 91% rename from bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineRepository.java rename to bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineHistoryRepository.java index e408595..9973bff 100644 --- a/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineRepository.java +++ b/bot-context/bot-context-simple/src/main/java/dev/struchkov/godfather/simple/context/repository/StorylineHistoryRepository.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; import java.util.Optional; -public interface StorylineRepository { +public interface StorylineHistoryRepository { void save(@NotNull StorylineHistory storylineHistory); diff --git a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineMailService.java b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineMailService.java index 09c309b..b8e6c5b 100644 --- a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineMailService.java +++ b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/service/StorylineMailService.java @@ -3,7 +3,7 @@ package dev.struchkov.godfather.quarkus.core.service; import dev.struchkov.godfather.main.domain.StorylineHistory; import dev.struchkov.godfather.main.domain.UnitPointer; import dev.struchkov.godfather.main.domain.content.Mail; -import dev.struchkov.godfather.quarkus.context.repository.StorylineRepository; +import dev.struchkov.godfather.quarkus.context.repository.StorylineHistoryRepository; import dev.struchkov.godfather.quarkus.context.service.UnitPointerService; import dev.struchkov.godfather.quarkus.core.Storyline; import dev.struchkov.godfather.quarkus.core.StorylineFactory; @@ -26,24 +26,24 @@ import static dev.struchkov.haiti.utils.Inspector.isNotNull; public class StorylineMailService implements StorylineService { private final UnitPointerService unitPointerService; - private final StorylineRepository storylineRepository; + private final StorylineHistoryRepository storylineHistoryRepository; private final Storyline storyLine; private String defaultUnitName; public StorylineMailService( UnitPointerService unitPointerService, - StorylineRepository storylineRepository, + StorylineHistoryRepository storylineHistoryRepository, List unitConfigurations ) { this.storyLine = new StorylineFactory(unitConfigurations).createStoryLine(); this.unitPointerService = unitPointerService; - this.storylineRepository = storylineRepository; + this.storylineHistoryRepository = storylineHistoryRepository; } @Override public Uni save(@NotNull StorylineHistory storylineHistory) { isNotNull(storylineHistory); - return storylineRepository.save(storylineHistory); + return storylineHistoryRepository.save(storylineHistory); } @Override @@ -69,7 +69,7 @@ public class StorylineMailService implements StorylineService { if (checkNotNull(unit) && checkNotEmpty(unit.getNextUnits())) { return Uni.createFrom().item(unit.getNextUnits()); } else { - return storylineRepository.cleanHistoryByPersonId(personId) + return storylineHistoryRepository.cleanHistoryByPersonId(personId) .onItem().transform(v -> storyLine.getStartingUnits()); } } @@ -94,18 +94,18 @@ public class StorylineMailService implements StorylineService { storylineHistory.setPersonId(personId); storylineHistory.setUnitName(unitName); storylineHistory.setMessage(mail); - return storylineRepository.save(storylineHistory); + return storylineHistoryRepository.save(storylineHistory); }).replaceWithVoid(); } @Override public Uni replaceUserToBack(String personId, int countUnitsToBack) { - return storylineRepository.findByCountLast(personId, countUnitsToBack); + return storylineHistoryRepository.findByCountLast(personId, countUnitsToBack); } @Override public Uni replaceUserToBack(String personId, String unitName) { - return storylineRepository.findByCountLast(personId, unitName); + return storylineHistoryRepository.findByCountLast(personId, unitName); } @Override @@ -121,7 +121,7 @@ public class StorylineMailService implements StorylineService { @Override public Uni cleanHistoryByPersonId(@NotNull String personId) { - return storylineRepository.cleanHistoryByPersonId(personId) + return storylineHistoryRepository.cleanHistoryByPersonId(personId) .call(() -> unitPointerService.removeByPersonId(personId)); } diff --git a/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineMailService.java b/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineMailService.java index 4940fb0..fdcb332 100644 --- a/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineMailService.java +++ b/bot-core/bot-core-simple/src/main/java/dev/struchkov/godfather/simple/core/service/StorylineMailService.java @@ -3,7 +3,7 @@ package dev.struchkov.godfather.simple.core.service; import dev.struchkov.godfather.main.domain.StorylineHistory; import dev.struchkov.godfather.main.domain.UnitPointer; import dev.struchkov.godfather.main.domain.content.Message; -import dev.struchkov.godfather.simple.context.repository.StorylineRepository; +import dev.struchkov.godfather.simple.context.repository.StorylineHistoryRepository; import dev.struchkov.godfather.simple.context.service.UnitPointerService; import dev.struchkov.godfather.simple.core.Storyline; import dev.struchkov.godfather.simple.core.StorylineFactory; @@ -22,24 +22,24 @@ import static dev.struchkov.haiti.utils.Inspector.isNotNull; public class StorylineMailService implements StorylineService { private final UnitPointerService unitPointerService; - private final StorylineRepository storylineRepository; + private final StorylineHistoryRepository storylineHistoryRepository; private final Storyline storyLine; private String defaultUnitName; public StorylineMailService( UnitPointerService unitPointerService, - StorylineRepository storylineRepository, + StorylineHistoryRepository storylineHistoryRepository, List unitConfigurations ) { this.storyLine = new StorylineFactory(unitConfigurations).createStoryLine(); this.unitPointerService = unitPointerService; - this.storylineRepository = storylineRepository; + this.storylineHistoryRepository = storylineHistoryRepository; } @Override public void save(@NotNull StorylineHistory storylineHistory) { isNotNull(storylineHistory); - storylineRepository.save(storylineHistory); + storylineHistoryRepository.save(storylineHistory); } @Override @@ -55,7 +55,7 @@ public class StorylineMailService implements StorylineService .map(MainUnit::getNextUnits) .filter(mainUnits -> !mainUnits.isEmpty()); if (optMainUnits.isEmpty()) { - storylineRepository.cleanHistoryByPersonId(personId); + storylineHistoryRepository.cleanHistoryByPersonId(personId); } final Set> nextUnits = optMainUnits.orElse(storyLine.getStartingUnits()); nextUnits.addAll(storyLine.getGlobalUnits()); @@ -71,17 +71,17 @@ public class StorylineMailService implements StorylineService storylineHistory.setPersonId(personId); storylineHistory.setUnitName(unitName); storylineHistory.setMessage(mail); - storylineRepository.save(storylineHistory); + storylineHistoryRepository.save(storylineHistory); } @Override public Optional replaceUserToBack(String personId, int countUnitsToBack) { - return storylineRepository.findByCountLast(personId, countUnitsToBack); + return storylineHistoryRepository.findByCountLast(personId, countUnitsToBack); } @Override public Optional replaceUserToBack(String personId, String unitName) { - return storylineRepository.findByCountLast(personId, unitName); + return storylineHistoryRepository.findByCountLast(personId, unitName); } @Override @@ -97,7 +97,7 @@ public class StorylineMailService implements StorylineService @Override public void cleanHistoryByPersonId(@NotNull String personId) { - storylineRepository.cleanHistoryByPersonId(personId); + storylineHistoryRepository.cleanHistoryByPersonId(personId); unitPointerService.removeByPersonId(personId); } diff --git a/bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapRepository.java b/bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapHistoryRepository.java similarity index 96% rename from bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapRepository.java rename to bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapHistoryRepository.java index f86fb43..aae299a 100644 --- a/bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapRepository.java +++ b/bot-data/bot-data-quarkus/src/main/java/dev/struchkov/godfather/quarkus/data/repository/impl/StorylineMapHistoryRepository.java @@ -1,7 +1,7 @@ package dev.struchkov.godfather.quarkus.data.repository.impl; import dev.struchkov.godfather.main.domain.StorylineHistory; -import dev.struchkov.godfather.quarkus.context.repository.StorylineRepository; +import dev.struchkov.godfather.quarkus.context.repository.StorylineHistoryRepository; import io.smallrye.mutiny.Uni; import org.jetbrains.annotations.NotNull; @@ -11,7 +11,7 @@ import java.util.Map; import java.util.Set; import java.util.Stack; -public class StorylineMapRepository implements StorylineRepository { +public class StorylineMapHistoryRepository implements StorylineHistoryRepository { private final Map> map = new HashMap<>(); private final Map> historyUnitName = new HashMap<>(); diff --git a/bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapRepository.java b/bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapHistoryRepository.java similarity index 95% rename from bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapRepository.java rename to bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapHistoryRepository.java index 8620aab..127f759 100644 --- a/bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapRepository.java +++ b/bot-data/bot-data-simple/src/main/java/dev/struchkov/godfather/simple/data/repository/impl/StorylineMapHistoryRepository.java @@ -1,7 +1,7 @@ package dev.struchkov.godfather.simple.data.repository.impl; import dev.struchkov.godfather.main.domain.StorylineHistory; -import dev.struchkov.godfather.simple.context.repository.StorylineRepository; +import dev.struchkov.godfather.simple.context.repository.StorylineHistoryRepository; import org.jetbrains.annotations.NotNull; import java.util.HashMap; @@ -11,7 +11,7 @@ import java.util.Optional; import java.util.Set; import java.util.Stack; -public class StorylineMapRepository implements StorylineRepository { +public class StorylineMapHistoryRepository implements StorylineHistoryRepository { private final Map> map = new HashMap<>(); private final Map> historyUnitName = new HashMap<>();