From e01418e5761eb4ce05809e69d843ca5cb66240d5 Mon Sep 17 00:00:00 2001 From: Anatoly Karlov Date: Tue, 13 Aug 2024 17:38:40 +0700 Subject: [PATCH] init structure --- .github/workflows/build.yml | 10 + .github/workflows/deploy.yml | 15 + .gitignore | 79 ++++++ pom.xml | 260 ++++++++++++++++++ .../disputes/DisputesApiApplication.java | 17 ++ src/main/resources/application.yml | 105 +++++++ .../disputes/P2pApiApplicationTest.java | 10 + 7 files changed, 496 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/dev/vality/disputes/DisputesApiApplication.java create mode 100644 src/main/resources/application.yml create mode 100644 src/test/java/dev/vality/disputes/P2pApiApplicationTest.java diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..dbb1a95 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,10 @@ +name: Maven Build Artifact + +on: + pull_request: + branches: + - '*' + +jobs: + build: + uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v3 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5cbf745 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,15 @@ +name: Deploy Docker Image + +on: + push: + branches: + - 'master' + +jobs: + build-and-deploy: + uses: valitydev/java-workflow/.github/workflows/maven-service-deploy.yml@v3 + with: + ignore-coverage: true + secrets: + github-token: ${{ secrets.GITHUB_TOKEN }} + mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..850bf26 --- /dev/null +++ b/.gitignore @@ -0,0 +1,79 @@ +# Created by .ignore support plugin (hsz.mobi) +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin/*.beam +rel/example_project +.concrete/DEV_MODE +.rebar +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/ +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +*.iws +*.ipr +*.iml + + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +env.list +.DS_Store diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6d788f6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,260 @@ + + + 4.0.0 + + + dev.vality + service-parent-pom + 3.0.2 + + + disputes-api + 0.0.1 + jar + + disputes-api + disputes api + + + UTF-8 + UTF-8 + 21 + ${java.version} + ${java.version} + 8022 + 8023 + ${server.port} ${management.port} + ${env.REGISTRY} + 2.10.5 + 2.0.1 + 3.0.0 + + + + + + dev.vality + swag-disputes + 1.13-5f24bbe-server + + + dev.vality + provider-disputes-proto + 1.4-591cf9c + + + dev.vality + bouncer-proto + 1.55-ef7403f + + + dev.vality.geck + serializer + + + dev.vality + damsel + + + dev.vality + token-keeper-proto + 1.37-be1f603 + + + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + org.hibernate + hibernate-validator + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework.retry + spring-retry + + + org.springframework + spring-web + 6.1.9 + + + + + org.postgresql + postgresql + + + jakarta.servlet + jakarta.servlet-api + 6.1.0 + provided + + + jakarta.inject + jakarta.inject-api + 2.0.1 + provided + + + io.swagger + swagger-annotations + 1.6.8 + provided + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + provided + + + org.openapitools + jackson-databind-nullable + 0.2.3 + provided + + + com.github.ben-manes.caffeine + caffeine + + + + + org.springframework.boot + spring-boot-starter-test + test + + + io.jsonwebtoken + jjwt-impl + 0.12.5 + test + + + io.jsonwebtoken + jjwt-api + 0.12.5 + test + + + io.jsonwebtoken + jjwt-jackson + 0.12.5 + test + + + com.github.tomakehurst + wiremock-jre8-standalone + 2.35.1 + test + + + org.springframework.cloud + spring-cloud-contract-wiremock + 4.1.3 + test + + + + + ${project.basedir}/src/main/java + ${project.basedir}/src/test/java + + + ${project.build.directory}/maven-shared-archive-resources + ${project.build.directory} + + Dockerfile + + true + + + ${project.build.directory}/maven-shared-archive-resources + true + + Dockerfile + + + + src/main/resources + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-remote-resources-plugin + 3.0.0 + + + org.apache.maven.shared + maven-filtering + 3.3.0 + + + + + dev.vality:shared-resources:${shared-resources.version} + + false + false + + + + + process + + + + + + + diff --git a/src/main/java/dev/vality/disputes/DisputesApiApplication.java b/src/main/java/dev/vality/disputes/DisputesApiApplication.java new file mode 100644 index 0000000..0b77070 --- /dev/null +++ b/src/main/java/dev/vality/disputes/DisputesApiApplication.java @@ -0,0 +1,17 @@ +package dev.vality.disputes; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.scheduling.annotation.EnableAsync; + +@EnableAsync +@ServletComponentScan +@SpringBootApplication +public class DisputesApiApplication extends SpringApplication { + + public static void main(String[] args) { + SpringApplication.run(DisputesApiApplication.class, args); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..39a861c --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,105 @@ +server: + port: ${server.port} + +management: + server: + port: ${management.port} + endpoint: + health: + show-details: always + metrics: + enabled: true + prometheus: + enabled: true + endpoints: + web: + exposure: + include: health,info,prometheus + prometheus: + metrics: + export: + enabled: true + +service: + invoicing: + url: http://localhost:8022/change_it + networkTimeout: 5000 + dominant: + url: http://localhost:8022/change_it + networkTimeout: 5000 + cache: + currencies: + poolSize: 10 + ttlSec: 86400 + terminals: + poolSize: 30 + ttlSec: 60 + providers: + poolSize: 20 + ttlSec: 300 + payment_services: + poolSize: 30 + ttlSec: 300 + proxies: + poolSize: 30 + ttlSec: 300 + bouncer: + url: http://localhost:8022/change_it + networkTimeout: 10000 + deployment-id: production + realm: external + rule-set-id: change_it + operation-id: change_it + auth: + enabled: false + tokenKeeper: + url: http://localhost:8022/change_it + networkTimeout: 5000 + adapters: + connection: + timeoutSec: 30 + poolSize: 10 + ttlMin: 1440 + reconnect: + maxAttempts: 3 + initialDelaySec: 1 + +spring: + application: + name: ${project.name} + output: + ansi: + enabled: always + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://localhost:5432/daway + username: postgres + password: postgres + threads: + virtual: + enabled: true + +info: + version: ${project.version} + stage: dev + +auth: + enabled: true + +cascade: + max-time-polling-sec: 5 + thread-sleep-ms: 100 + +metrics: + woody: + name: p2p.api.woody.client.request + +bank-details: + bic: + alfabank: "044525593" + raiffeisen: "044525700" + sberbank: "044525225" + tinkoff: "044525974" + purpose: + sberbank: Перевод diff --git a/src/test/java/dev/vality/disputes/P2pApiApplicationTest.java b/src/test/java/dev/vality/disputes/P2pApiApplicationTest.java new file mode 100644 index 0000000..9c49136 --- /dev/null +++ b/src/test/java/dev/vality/disputes/P2pApiApplicationTest.java @@ -0,0 +1,10 @@ +package dev.vality.disputes; + +import org.junit.jupiter.api.Test; + +class P2pApiApplicationTest { + @Test + public void up() { + + } +} \ No newline at end of file