From 470ee0e87603fed8d3e0b4bb096fc1556b4bc674 Mon Sep 17 00:00:00 2001 From: Panos Karampis Date: Tue, 1 Oct 2024 09:19:04 +0200 Subject: [PATCH] new base --- .dockerignore | 5 + .github/workflows/docker-build.yml | 4 +- .sdkmanrc | 3 + README.md | 18 +- pom.xml | 326 +++++++++--------- src/main/docker/Dockerfile.jvm | 10 +- src/main/docker/Dockerfile.legacy-jar | 8 +- src/main/docker/Dockerfile.native | 6 +- src/main/docker/Dockerfile.native-micro | 4 +- .../promofacie}/CommandListener.java | 6 +- .../promofacie}/DiscordApiDI.java | 3 +- .../promofacie}/JacksonConfiguration.java | 2 +- .../promofacie}/StartUp.java | 2 +- .../promofacie}/TransactionListener.java | 11 +- .../promofacie}/db/Wallet.java | 2 +- .../kafka/KafkaVerificationService.java | 6 +- .../kafka/VerificationConsumer.java | 8 +- .../kafka/model/VerificationDeserializer.java | 2 +- .../kafka/model/VerificationOutcome.java | 2 +- .../promofacie}/radix/RadixClient.java | 12 +- .../radix/model/AddressStateDetails.java | 3 +- .../radix/model/GetAddressDetails.java | 2 +- .../model/GetTransactionsStreamRequest.java | 2 +- .../model/GetTransactionsStreamResponse.java | 5 +- .../promofacie}/redis/RedisRepository.java | 4 +- .../redis/RedisVerificationService.java | 4 +- .../redis/VerificationRepository.java | 4 +- .../promofacie/redis/redis_model/Status.java | 4 + .../redis/redis_model/Verification.java | 2 +- .../BlockchainVerificationService.java | 2 +- .../promofacie}/service/FooResource.java | 8 +- .../service/RadixVerificationService.java | 8 +- .../promofacie}/service/RoleService.java | 11 +- .../promofacie}/task/Scheduler.java | 5 +- .../redis/redis_model/Status.java | 4 - src/main/resources/application.properties | 6 +- 36 files changed, 262 insertions(+), 252 deletions(-) create mode 100644 .dockerignore create mode 100644 .sdkmanrc rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/CommandListener.java (89%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/DiscordApiDI.java (94%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/JacksonConfiguration.java (95%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/StartUp.java (90%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/TransactionListener.java (90%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/db/Wallet.java (91%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/kafka/KafkaVerificationService.java (81%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/kafka/VerificationConsumer.java (85%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/kafka/model/VerificationDeserializer.java (81%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/kafka/model/VerificationOutcome.java (94%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/radix/RadixClient.java (65%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/radix/model/AddressStateDetails.java (94%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/radix/model/GetAddressDetails.java (94%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/radix/model/GetTransactionsStreamRequest.java (90%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/radix/model/GetTransactionsStreamResponse.java (88%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/redis/RedisRepository.java (95%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/redis/RedisVerificationService.java (82%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/redis/VerificationRepository.java (68%) create mode 100644 src/main/java/dk/panos/promofacie/redis/redis_model/Status.java rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/redis/redis_model/Verification.java (86%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/service/BlockchainVerificationService.java (79%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/service/FooResource.java (89%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/service/RadixVerificationService.java (84%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/service/RoleService.java (96%) rename src/main/java/dk/{promofacie/wallet_verification => panos/promofacie}/task/Scheduler.java (85%) delete mode 100644 src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Status.java diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..94810d0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6ebc79d..80d0ffd 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' # Alternatively, you can use 'graalvm' if you want GraalVM JDK for Java 17 - java-version: '17' + java-version: '21' # Set up Docker Buildx (required for multi-platform builds) - name: Set up Docker Buildx @@ -41,4 +41,4 @@ jobs: # Build and Push Docker Image - name: Build and push Docker image run: | - docker buildx build --push --platform linux/amd64 -f src/main/docker/Dockerfile.jvm -t r0ufif0u/metaflux:promofacie-verifier-r0 . + docker buildx build --push --platform linux/amd64 -f src/main/docker/Dockerfile.jvm -t r0ufif0u/metaflux:promofacie-verifier . diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 0000000..fcebd7d --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1,3 @@ +# Enable auto-env through the sdkman_auto_env config +# Add key=value pairs of SDKs to use below +java=21.0.4-tem diff --git a/README.md b/README.md index 6215cd3..4a20a97 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# danbot +# wallet-verification This project uses Quarkus, the Supersonic Subatomic Java Framework. @@ -49,12 +49,26 @@ Or, if you don't have GraalVM installed, you can run the native executable build ./mvnw package -Dnative -Dquarkus.native.container-build=true ``` -You can then execute your native executable with: `./target/danbot-1.0-runner` +You can then execute your native executable with: `./target/wallet-verification-1.0.0-SNAPSHOT-runner` If you want to learn more about building native executables, please consult . +## Related Guides + +- Messaging - Kafka Connector ([guide](https://quarkus.io/guides/kafka-getting-started)): Connect to Kafka with Reactive Messaging +- Redis Client ([guide](https://quarkus.io/guides/redis)): Connect to Redis in either imperative or reactive style +- Vault ([guide](https://quarkiverse.github.io/quarkiverse-docs/quarkus-vault/dev/index.html)): Store your credentials securely in HashiCorp Vault +- SmallRye Context Propagation ([guide](https://quarkus.io/guides/context-propagation)): Propagate contexts between managed threads in reactive applications + ## Provided Code +### Messaging codestart + +Use Quarkus Messaging + +[Related Apache Kafka guide section...](https://quarkus.io/guides/kafka-reactive-getting-started) + + ### REST Easily start your REST Web Services diff --git a/pom.xml b/pom.xml index bf37286..b024f3b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,169 +1,165 @@ - - 4.0.0 - dk.promofacie - verifier - 1.0 - - 3.13.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.13.2 - true - 3.2.5 - - + + 4.0.0 + dk.panos.promofacie + wallet-verification + 1.0.0-SNAPSHOT + + + 3.13.0 + 21 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 3.15.1 + true + 3.3.1 + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - + + io.quarkus + quarkus-hibernate-reactive-panache + + + io.quarkus + quarkus-rest-client-jackson + + + io.quarkus + quarkus-messaging-kafka + + + io.quarkus + quarkus-redis-client + + + io.quarkiverse.vault + quarkus-vault + + + io.quarkus + quarkus-smallrye-context-propagation + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-reactive-pg-client + + + net.dv8tion + JDA + 5.1.0 + + + io.quarkus + quarkus-scheduler + + + io.quarkus + quarkus-rest-jackson + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + - - - - io.quarkus - quarkus-arc - - - io.quarkus - quarkus-rest - - - io.quarkus - quarkus-rest-client-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-redis-client - - - io.quarkus - quarkus-hibernate-reactive-panache - - - io.quarkus - quarkus-hibernate-reactive - - - io.quarkus - quarkus-reactive-pg-client - - - io.quarkus - quarkus-messaging-kafka - - - io.quarkus - quarkus-smallrye-context-propagation - - - io.quarkus - quarkus-scheduler - - - io.quarkiverse.vault - quarkus-vault - - - net.dv8tion - JDA - 5.1.0 - - - io.quarkiverse.loggingsentry - quarkus-logging-sentry - 2.0.7 - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - true - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - native - - - native - - - - false - true - - - + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + true + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + true + + + diff --git a/src/main/docker/Dockerfile.jvm b/src/main/docker/Dockerfile.jvm index 4d799eb..6556a2c 100644 --- a/src/main/docker/Dockerfile.jvm +++ b/src/main/docker/Dockerfile.jvm @@ -7,11 +7,11 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/danbot-jvm . +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/wallet-verification-jvm . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/danbot-jvm +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification-jvm # # If you want to include the debug port into your docker image # you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. @@ -20,7 +20,7 @@ # # Then run the container using : # -# docker run -i --rm -p 8080:8080 quarkus/danbot-jvm +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification-jvm # # This image uses the `run-java.sh` script to run the application. # This scripts computes the command line to execute your Java application, and @@ -77,8 +77,8 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -#FROM registry.access.redhat.com/ubi8/openjdk-21:1.19 -FROM registry.access.redhat.com/ubi8/openjdk-21:1.18-3 +FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 + ENV LANGUAGE='en_US:en' diff --git a/src/main/docker/Dockerfile.legacy-jar b/src/main/docker/Dockerfile.legacy-jar index eb86166..277231c 100644 --- a/src/main/docker/Dockerfile.legacy-jar +++ b/src/main/docker/Dockerfile.legacy-jar @@ -7,11 +7,11 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/danbot-legacy-jar . +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/wallet-verification-legacy-jar . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/danbot-legacy-jar +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification-legacy-jar # # If you want to include the debug port into your docker image # you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. @@ -20,7 +20,7 @@ # # Then run the container using : # -# docker run -i --rm -p 8080:8080 quarkus/danbot-legacy-jar +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification-legacy-jar # # This image uses the `run-java.sh` script to run the application. # This scripts computes the command line to execute your Java application, and @@ -77,7 +77,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-21:1.19 +FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 ENV LANGUAGE='en_US:en' diff --git a/src/main/docker/Dockerfile.native b/src/main/docker/Dockerfile.native index 91a9777..70b7407 100644 --- a/src/main/docker/Dockerfile.native +++ b/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/danbot . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/wallet-verification . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/danbot +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/src/main/docker/Dockerfile.native-micro b/src/main/docker/Dockerfile.native-micro index 4f16a54..5cf97b7 100644 --- a/src/main/docker/Dockerfile.native-micro +++ b/src/main/docker/Dockerfile.native-micro @@ -10,11 +10,11 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/danbot . +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/wallet-verification . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/danbot +# docker run -i --rm -p 8080:8080 quarkus/wallet-verification # ### FROM quay.io/quarkus/quarkus-micro-image:2.0 diff --git a/src/main/java/dk/promofacie/wallet_verification/CommandListener.java b/src/main/java/dk/panos/promofacie/CommandListener.java similarity index 89% rename from src/main/java/dk/promofacie/wallet_verification/CommandListener.java rename to src/main/java/dk/panos/promofacie/CommandListener.java index 6e6ce49..dabd3c6 100644 --- a/src/main/java/dk/promofacie/wallet_verification/CommandListener.java +++ b/src/main/java/dk/panos/promofacie/CommandListener.java @@ -1,7 +1,7 @@ -package dk.promofacie.wallet_verification; +package dk.panos.promofacie; -import dk.promofacie.wallet_verification.redis.RedisVerificationService; -import dk.promofacie.wallet_verification.redis.redis_model.Verification; +import dk.panos.promofacie.redis.RedisVerificationService; +import dk.panos.promofacie.redis.redis_model.Verification; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; diff --git a/src/main/java/dk/promofacie/wallet_verification/DiscordApiDI.java b/src/main/java/dk/panos/promofacie/DiscordApiDI.java similarity index 94% rename from src/main/java/dk/promofacie/wallet_verification/DiscordApiDI.java rename to src/main/java/dk/panos/promofacie/DiscordApiDI.java index 39d579f..84c6ec8 100644 --- a/src/main/java/dk/promofacie/wallet_verification/DiscordApiDI.java +++ b/src/main/java/dk/panos/promofacie/DiscordApiDI.java @@ -1,6 +1,5 @@ -package dk.promofacie.wallet_verification; +package dk.panos.promofacie; -import io.smallrye.common.annotation.Blocking; import jakarta.inject.Singleton; import jakarta.ws.rs.Produces; import net.dv8tion.jda.api.JDA; diff --git a/src/main/java/dk/promofacie/wallet_verification/JacksonConfiguration.java b/src/main/java/dk/panos/promofacie/JacksonConfiguration.java similarity index 95% rename from src/main/java/dk/promofacie/wallet_verification/JacksonConfiguration.java rename to src/main/java/dk/panos/promofacie/JacksonConfiguration.java index aef9d97..2c41754 100644 --- a/src/main/java/dk/promofacie/wallet_verification/JacksonConfiguration.java +++ b/src/main/java/dk/panos/promofacie/JacksonConfiguration.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification; +package dk.panos.promofacie; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategies; diff --git a/src/main/java/dk/promofacie/wallet_verification/StartUp.java b/src/main/java/dk/panos/promofacie/StartUp.java similarity index 90% rename from src/main/java/dk/promofacie/wallet_verification/StartUp.java rename to src/main/java/dk/panos/promofacie/StartUp.java index 34c4046..74388e0 100644 --- a/src/main/java/dk/promofacie/wallet_verification/StartUp.java +++ b/src/main/java/dk/panos/promofacie/StartUp.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification; +package dk.panos.promofacie; import io.quarkus.runtime.StartupEvent; import jakarta.enterprise.context.ApplicationScoped; diff --git a/src/main/java/dk/promofacie/wallet_verification/TransactionListener.java b/src/main/java/dk/panos/promofacie/TransactionListener.java similarity index 90% rename from src/main/java/dk/promofacie/wallet_verification/TransactionListener.java rename to src/main/java/dk/panos/promofacie/TransactionListener.java index 30f4e03..3a040bc 100644 --- a/src/main/java/dk/promofacie/wallet_verification/TransactionListener.java +++ b/src/main/java/dk/panos/promofacie/TransactionListener.java @@ -1,9 +1,9 @@ -package dk.promofacie.wallet_verification; +package dk.panos.promofacie; -import dk.promofacie.wallet_verification.kafka.KafkaVerificationService; -import dk.promofacie.wallet_verification.redis.RedisVerificationService; -import dk.promofacie.wallet_verification.redis.redis_model.Verification; -import dk.promofacie.wallet_verification.service.BlockchainVerificationService; +import dk.panos.promofacie.kafka.KafkaVerificationService; +import dk.panos.promofacie.redis.RedisVerificationService; +import dk.panos.promofacie.redis.redis_model.Verification; +import dk.panos.promofacie.service.BlockchainVerificationService; import io.quarkus.arc.profile.IfBuildProfile; import io.quarkus.runtime.StartupEvent; import io.smallrye.mutiny.Multi; @@ -41,6 +41,7 @@ public void listen(@Observes StartupEvent ev) { .onItem() .transformToUni(verification -> blockchainVerificationService.transactionExists(verification.address(), verification.discordId(), verification.dateTime()) + .onFailure().invoke(err -> log.error(err.getMessage())) .onFailure().retry().withBackOff(Duration.ofMillis(100)) .atMost(100) .map(outcome -> Tuple2.of(verification, outcome)) diff --git a/src/main/java/dk/promofacie/wallet_verification/db/Wallet.java b/src/main/java/dk/panos/promofacie/db/Wallet.java similarity index 91% rename from src/main/java/dk/promofacie/wallet_verification/db/Wallet.java rename to src/main/java/dk/panos/promofacie/db/Wallet.java index 47b6143..7d4a503 100644 --- a/src/main/java/dk/promofacie/wallet_verification/db/Wallet.java +++ b/src/main/java/dk/panos/promofacie/db/Wallet.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.db; +package dk.panos.promofacie.db; import io.quarkus.hibernate.reactive.panache.PanacheEntity; import jakarta.persistence.Entity; diff --git a/src/main/java/dk/promofacie/wallet_verification/kafka/KafkaVerificationService.java b/src/main/java/dk/panos/promofacie/kafka/KafkaVerificationService.java similarity index 81% rename from src/main/java/dk/promofacie/wallet_verification/kafka/KafkaVerificationService.java rename to src/main/java/dk/panos/promofacie/kafka/KafkaVerificationService.java index b15c6e4..e0f6362 100644 --- a/src/main/java/dk/promofacie/wallet_verification/kafka/KafkaVerificationService.java +++ b/src/main/java/dk/panos/promofacie/kafka/KafkaVerificationService.java @@ -1,7 +1,7 @@ -package dk.promofacie.wallet_verification.kafka; +package dk.panos.promofacie.kafka; -import dk.promofacie.wallet_verification.kafka.model.VerificationOutcome; -import dk.promofacie.wallet_verification.redis.redis_model.Verification; +import dk.panos.promofacie.kafka.model.VerificationOutcome; +import dk.panos.promofacie.redis.redis_model.Verification; import io.smallrye.mutiny.Uni; import io.smallrye.reactive.messaging.MutinyEmitter; import jakarta.enterprise.context.ApplicationScoped; diff --git a/src/main/java/dk/promofacie/wallet_verification/kafka/VerificationConsumer.java b/src/main/java/dk/panos/promofacie/kafka/VerificationConsumer.java similarity index 85% rename from src/main/java/dk/promofacie/wallet_verification/kafka/VerificationConsumer.java rename to src/main/java/dk/panos/promofacie/kafka/VerificationConsumer.java index 0198b97..e251c90 100644 --- a/src/main/java/dk/promofacie/wallet_verification/kafka/VerificationConsumer.java +++ b/src/main/java/dk/panos/promofacie/kafka/VerificationConsumer.java @@ -1,8 +1,8 @@ -package dk.promofacie.wallet_verification.kafka; +package dk.panos.promofacie.kafka; -import dk.promofacie.wallet_verification.db.Wallet; -import dk.promofacie.wallet_verification.kafka.model.VerificationOutcome; -import dk.promofacie.wallet_verification.redis.RedisVerificationService; +import dk.panos.promofacie.db.Wallet; +import dk.panos.promofacie.kafka.model.VerificationOutcome; +import dk.panos.promofacie.redis.RedisVerificationService; import io.quarkus.hibernate.reactive.panache.common.WithTransaction; import io.quarkus.panache.common.Parameters; import io.smallrye.mutiny.Uni; diff --git a/src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationDeserializer.java b/src/main/java/dk/panos/promofacie/kafka/model/VerificationDeserializer.java similarity index 81% rename from src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationDeserializer.java rename to src/main/java/dk/panos/promofacie/kafka/model/VerificationDeserializer.java index 57fde11..59ebc26 100644 --- a/src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationDeserializer.java +++ b/src/main/java/dk/panos/promofacie/kafka/model/VerificationDeserializer.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.kafka.model; +package dk.panos.promofacie.kafka.model; import io.quarkus.kafka.client.serialization.ObjectMapperDeserializer; diff --git a/src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationOutcome.java b/src/main/java/dk/panos/promofacie/kafka/model/VerificationOutcome.java similarity index 94% rename from src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationOutcome.java rename to src/main/java/dk/panos/promofacie/kafka/model/VerificationOutcome.java index 81264d4..a319968 100644 --- a/src/main/java/dk/promofacie/wallet_verification/kafka/model/VerificationOutcome.java +++ b/src/main/java/dk/panos/promofacie/kafka/model/VerificationOutcome.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.kafka.model; +package dk.panos.promofacie.kafka.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/dk/promofacie/wallet_verification/radix/RadixClient.java b/src/main/java/dk/panos/promofacie/radix/RadixClient.java similarity index 65% rename from src/main/java/dk/promofacie/wallet_verification/radix/RadixClient.java rename to src/main/java/dk/panos/promofacie/radix/RadixClient.java index 79b0c9e..513d099 100644 --- a/src/main/java/dk/promofacie/wallet_verification/radix/RadixClient.java +++ b/src/main/java/dk/panos/promofacie/radix/RadixClient.java @@ -1,10 +1,10 @@ -package dk.promofacie.wallet_verification.radix; +package dk.panos.promofacie.radix; -import dk.promofacie.wallet_verification.radix.model.AddressStateDetails; -import dk.promofacie.wallet_verification.radix.model.GetAddressDetails; -import dk.promofacie.wallet_verification.radix.model.GetTransactionsStreamRequest; -import dk.promofacie.wallet_verification.radix.model.GetTransactionsStreamResponse; -import dk.promofacie.wallet_verification.service.FooResource; +import dk.panos.promofacie.radix.model.AddressStateDetails; +import dk.panos.promofacie.radix.model.GetAddressDetails; +import dk.panos.promofacie.radix.model.GetTransactionsStreamRequest; +import dk.panos.promofacie.radix.model.GetTransactionsStreamResponse; +import dk.panos.promofacie.service.FooResource; import io.smallrye.mutiny.Uni; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; diff --git a/src/main/java/dk/promofacie/wallet_verification/radix/model/AddressStateDetails.java b/src/main/java/dk/panos/promofacie/radix/model/AddressStateDetails.java similarity index 94% rename from src/main/java/dk/promofacie/wallet_verification/radix/model/AddressStateDetails.java rename to src/main/java/dk/panos/promofacie/radix/model/AddressStateDetails.java index 99cb5b1..920d2a9 100644 --- a/src/main/java/dk/promofacie/wallet_verification/radix/model/AddressStateDetails.java +++ b/src/main/java/dk/panos/promofacie/radix/model/AddressStateDetails.java @@ -1,6 +1,5 @@ -package dk.promofacie.wallet_verification.radix.model; +package dk.panos.promofacie.radix.model; -import java.time.ZonedDateTime; import java.util.List; // Define the main record that encompasses the entire JSON structure diff --git a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetAddressDetails.java b/src/main/java/dk/panos/promofacie/radix/model/GetAddressDetails.java similarity index 94% rename from src/main/java/dk/promofacie/wallet_verification/radix/model/GetAddressDetails.java rename to src/main/java/dk/panos/promofacie/radix/model/GetAddressDetails.java index 95c107e..67303e6 100644 --- a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetAddressDetails.java +++ b/src/main/java/dk/panos/promofacie/radix/model/GetAddressDetails.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.radix.model; +package dk.panos.promofacie.radix.model; import java.util.List; diff --git a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamRequest.java b/src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamRequest.java similarity index 90% rename from src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamRequest.java rename to src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamRequest.java index f70a004..5a02ede 100644 --- a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamRequest.java +++ b/src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamRequest.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.radix.model; +package dk.panos.promofacie.radix.model; import java.time.ZonedDateTime; import java.util.List; diff --git a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamResponse.java b/src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamResponse.java similarity index 88% rename from src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamResponse.java rename to src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamResponse.java index 957ecfd..24b37d4 100644 --- a/src/main/java/dk/promofacie/wallet_verification/radix/model/GetTransactionsStreamResponse.java +++ b/src/main/java/dk/panos/promofacie/radix/model/GetTransactionsStreamResponse.java @@ -1,9 +1,6 @@ -package dk.promofacie.wallet_verification.radix.model; - -import com.fasterxml.jackson.annotation.JsonProperty; +package dk.panos.promofacie.radix.model; import java.util.List; -import java.util.Map; // Define the top-level record public record GetTransactionsStreamResponse( diff --git a/src/main/java/dk/promofacie/wallet_verification/redis/RedisRepository.java b/src/main/java/dk/panos/promofacie/redis/RedisRepository.java similarity index 95% rename from src/main/java/dk/promofacie/wallet_verification/redis/RedisRepository.java rename to src/main/java/dk/panos/promofacie/redis/RedisRepository.java index 22cd38b..8633284 100644 --- a/src/main/java/dk/promofacie/wallet_verification/redis/RedisRepository.java +++ b/src/main/java/dk/panos/promofacie/redis/RedisRepository.java @@ -1,6 +1,6 @@ -package dk.promofacie.wallet_verification.redis; +package dk.panos.promofacie.redis; -import dk.promofacie.wallet_verification.redis.redis_model.Verification; +import dk.panos.promofacie.redis.redis_model.Verification; import io.quarkus.redis.datasource.ReactiveRedisDataSource; import io.quarkus.redis.datasource.hash.ReactiveHashCommands; import io.quarkus.redis.datasource.set.ReactiveSetCommands; diff --git a/src/main/java/dk/promofacie/wallet_verification/redis/RedisVerificationService.java b/src/main/java/dk/panos/promofacie/redis/RedisVerificationService.java similarity index 82% rename from src/main/java/dk/promofacie/wallet_verification/redis/RedisVerificationService.java rename to src/main/java/dk/panos/promofacie/redis/RedisVerificationService.java index 6c2e04f..9a5ad7e 100644 --- a/src/main/java/dk/promofacie/wallet_verification/redis/RedisVerificationService.java +++ b/src/main/java/dk/panos/promofacie/redis/RedisVerificationService.java @@ -1,6 +1,6 @@ -package dk.promofacie.wallet_verification.redis; +package dk.panos.promofacie.redis; -import dk.promofacie.wallet_verification.redis.redis_model.Verification; +import dk.panos.promofacie.redis.redis_model.Verification; import io.smallrye.mutiny.Uni; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/src/main/java/dk/promofacie/wallet_verification/redis/VerificationRepository.java b/src/main/java/dk/panos/promofacie/redis/VerificationRepository.java similarity index 68% rename from src/main/java/dk/promofacie/wallet_verification/redis/VerificationRepository.java rename to src/main/java/dk/panos/promofacie/redis/VerificationRepository.java index 79b6a33..ad3a9e6 100644 --- a/src/main/java/dk/promofacie/wallet_verification/redis/VerificationRepository.java +++ b/src/main/java/dk/panos/promofacie/redis/VerificationRepository.java @@ -1,6 +1,4 @@ -package dk.promofacie.wallet_verification.redis; - -import io.smallrye.mutiny.Uni; +package dk.panos.promofacie.redis; public interface VerificationRepository { // Uni passwordResetSuccess(String stakeAddress, String username); diff --git a/src/main/java/dk/panos/promofacie/redis/redis_model/Status.java b/src/main/java/dk/panos/promofacie/redis/redis_model/Status.java new file mode 100644 index 0000000..8bf6b62 --- /dev/null +++ b/src/main/java/dk/panos/promofacie/redis/redis_model/Status.java @@ -0,0 +1,4 @@ +package dk.panos.promofacie.redis.redis_model; + +public record Status(String username) { +} diff --git a/src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Verification.java b/src/main/java/dk/panos/promofacie/redis/redis_model/Verification.java similarity index 86% rename from src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Verification.java rename to src/main/java/dk/panos/promofacie/redis/redis_model/Verification.java index 5e2d2e7..19df61b 100644 --- a/src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Verification.java +++ b/src/main/java/dk/panos/promofacie/redis/redis_model/Verification.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.redis.redis_model; +package dk.panos.promofacie.redis.redis_model; import java.time.ZonedDateTime; diff --git a/src/main/java/dk/promofacie/wallet_verification/service/BlockchainVerificationService.java b/src/main/java/dk/panos/promofacie/service/BlockchainVerificationService.java similarity index 79% rename from src/main/java/dk/promofacie/wallet_verification/service/BlockchainVerificationService.java rename to src/main/java/dk/panos/promofacie/service/BlockchainVerificationService.java index 554bd2c..6c63713 100644 --- a/src/main/java/dk/promofacie/wallet_verification/service/BlockchainVerificationService.java +++ b/src/main/java/dk/panos/promofacie/service/BlockchainVerificationService.java @@ -1,4 +1,4 @@ -package dk.promofacie.wallet_verification.service; +package dk.panos.promofacie.service; import io.smallrye.mutiny.Uni; diff --git a/src/main/java/dk/promofacie/wallet_verification/service/FooResource.java b/src/main/java/dk/panos/promofacie/service/FooResource.java similarity index 89% rename from src/main/java/dk/promofacie/wallet_verification/service/FooResource.java rename to src/main/java/dk/panos/promofacie/service/FooResource.java index f99ef20..6a4df57 100644 --- a/src/main/java/dk/promofacie/wallet_verification/service/FooResource.java +++ b/src/main/java/dk/panos/promofacie/service/FooResource.java @@ -1,8 +1,8 @@ -package dk.promofacie.wallet_verification.service; +package dk.panos.promofacie.service; -import dk.promofacie.wallet_verification.db.Wallet; -import dk.promofacie.wallet_verification.radix.RadixClient; -import dk.promofacie.wallet_verification.radix.model.GetTransactionsStreamResponse; +import dk.panos.promofacie.db.Wallet; +import dk.panos.promofacie.radix.RadixClient; +import dk.panos.promofacie.radix.model.GetTransactionsStreamResponse; import io.quarkus.hibernate.reactive.panache.common.WithTransaction; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; diff --git a/src/main/java/dk/promofacie/wallet_verification/service/RadixVerificationService.java b/src/main/java/dk/panos/promofacie/service/RadixVerificationService.java similarity index 84% rename from src/main/java/dk/promofacie/wallet_verification/service/RadixVerificationService.java rename to src/main/java/dk/panos/promofacie/service/RadixVerificationService.java index e563ef4..ff6460c 100644 --- a/src/main/java/dk/promofacie/wallet_verification/service/RadixVerificationService.java +++ b/src/main/java/dk/panos/promofacie/service/RadixVerificationService.java @@ -1,8 +1,8 @@ -package dk.promofacie.wallet_verification.service; +package dk.panos.promofacie.service; -import dk.promofacie.wallet_verification.radix.RadixClient; -import dk.promofacie.wallet_verification.radix.model.GetTransactionsStreamRequest; -import dk.promofacie.wallet_verification.radix.model.GetTransactionsStreamResponse; +import dk.panos.promofacie.radix.RadixClient; +import dk.panos.promofacie.radix.model.GetTransactionsStreamRequest; +import dk.panos.promofacie.radix.model.GetTransactionsStreamResponse; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import jakarta.enterprise.context.ApplicationScoped; diff --git a/src/main/java/dk/promofacie/wallet_verification/service/RoleService.java b/src/main/java/dk/panos/promofacie/service/RoleService.java similarity index 96% rename from src/main/java/dk/promofacie/wallet_verification/service/RoleService.java rename to src/main/java/dk/panos/promofacie/service/RoleService.java index 14ff28d..63a32cf 100644 --- a/src/main/java/dk/promofacie/wallet_verification/service/RoleService.java +++ b/src/main/java/dk/panos/promofacie/service/RoleService.java @@ -1,9 +1,9 @@ -package dk.promofacie.wallet_verification.service; +package dk.panos.promofacie.service; -import dk.promofacie.wallet_verification.db.Wallet; -import dk.promofacie.wallet_verification.radix.RadixClient; -import dk.promofacie.wallet_verification.radix.model.AddressStateDetails; -import dk.promofacie.wallet_verification.radix.model.GetAddressDetails; +import dk.panos.promofacie.db.Wallet; +import dk.panos.promofacie.radix.RadixClient; +import dk.panos.promofacie.radix.model.AddressStateDetails; +import dk.panos.promofacie.radix.model.GetAddressDetails; import io.quarkus.hibernate.reactive.panache.common.WithTransaction; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; @@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull; import java.math.BigDecimal; -import java.math.BigInteger; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.*; diff --git a/src/main/java/dk/promofacie/wallet_verification/task/Scheduler.java b/src/main/java/dk/panos/promofacie/task/Scheduler.java similarity index 85% rename from src/main/java/dk/promofacie/wallet_verification/task/Scheduler.java rename to src/main/java/dk/panos/promofacie/task/Scheduler.java index ac0e6e8..462b09c 100644 --- a/src/main/java/dk/promofacie/wallet_verification/task/Scheduler.java +++ b/src/main/java/dk/panos/promofacie/task/Scheduler.java @@ -1,7 +1,6 @@ -package dk.promofacie.wallet_verification.task; +package dk.panos.promofacie.task; -import dk.promofacie.wallet_verification.CommandListener; -import dk.promofacie.wallet_verification.service.RoleService; +import dk.panos.promofacie.service.RoleService; import io.quarkus.arc.profile.IfBuildProfile; import io.quarkus.hibernate.reactive.panache.common.WithTransaction; import io.quarkus.scheduler.Scheduled; diff --git a/src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Status.java b/src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Status.java deleted file mode 100644 index 4159bd2..0000000 --- a/src/main/java/dk/promofacie/wallet_verification/redis/redis_model/Status.java +++ /dev/null @@ -1,4 +0,0 @@ -package dk.promofacie.wallet_verification.redis.redis_model; - -public record Status(String username) { -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6077ce3..f43041b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,7 +13,7 @@ quarkus.vault.kv-secret-engine-version=2 %prod.kafka.bootstrap.servers=kafka-0.kafka-headless.shared-services.svc.cluster.local:9092,kafka-1.kafka-headless.shared-services.svc.cluster.local:9092 mp.messaging.incoming.verifier-rdx.connector=smallrye-kafka -mp.messaging.incoming.verifier-rdx.value.deserializer=dk.promofacie.wallet_verification.kafka.model.VerificationDeserializer +mp.messaging.incoming.verifier-rdx.value.deserializer=dk.panos.promofacie.kafka.model.VerificationDeserializer mp.messaging.incoming.verifier-rdx.auto.offset.reset=earliest mp.messaging.incoming.verifier-rdx.failure-strategy=ignore mp.messaging.outgoing.verifierout-rdx.connector=smallrye-kafka @@ -26,9 +26,9 @@ quarkus.redis.hosts=redis://redis-service quarkus.datasource.username=${POSTGRES_USERNAME} quarkus.datasource.password=${POSTGRES_PASSWORD} quarkus.datasource.reactive.url=vertx-reactive:postgresql://postgresql-service/verifier -%dev.quarkus.datasource.reactive.url=vertx-reactive:postgresql://localhost:6431/verifier +%dev.quarkus.datasource.reactive.url=vertx-reactive:postgresql://localhost:6430/verifier quarkus.datasource.db-kind=postgresql quarkus.hibernate-orm.log.sql=false -quarkus.hibernate-orm.database.generation=validate +quarkus.hibernate-orm.database.generation=update discord_api_key=${DISCORD_API_KEY} \ No newline at end of file