diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b78e497 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*.{kt,kts}] +ktlint_disabled_rules = import-ordering \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 70cd94f..a38e2c5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,14 +1,15 @@ --- -name: πŸͺ² Bugs report -about: Π‘ΠΎΠ·Π΄Π°ΠΉΡ‚Π΅ ΠΎΡ‚Ρ‡Π΅Ρ‚ ΠΎΠ± ошибкС, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΌΡ‹ ΠΌΠΎΠ³Π»ΠΈ Π·Π°Π½ΡΡ‚ΡŒΡΡ ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΠ΅ΠΌ -title: '[BUG] ΠšΠΎΡ€ΠΎΡ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ошибки.' -labels: 'type: bug, priority: low, status: backlog' -assignees: 'SmithyVL' - +name: πŸͺ² Ошибка +about: Π‘ΠΎΠ·Π΄Π°ΠΉΡ‚Π΅ Π·Π°Π΄Π°Ρ‡Ρƒ с ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹ΠΌ описаниСм ошибки, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΌΡ‹ ΠΌΠΎΠ³Π»ΠΈ Π·Π°Π½ΡΡ‚ΡŒΡΡ исправлСниСм +title: "ΠšΠΎΡ€ΠΎΡ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: bug"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС ошибки** -Π§Π΅Ρ‚ΠΊΠΎΠ΅ ΠΈ ΠΊΡ€Π°Ρ‚ΠΊΠΎΠ΅ описаниС ошибки. +Π§Π΅Ρ‚ΠΊΠΎΠ΅ ΠΈ ΠΊΡ€Π°Ρ‚ΠΊΠΎΠ΅ описаниС. **ВоспроизвСдСниС** Π¨Π°Π³ΠΈ ΠΏΠΎ Π²ΠΎΡΠΏΡ€ΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΡŽ повСдСния: @@ -27,4 +28,4 @@ assignees: 'SmithyVL' Если Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ, поТалуйста, ΠΏΡ€ΠΈΠΊΡ€Π΅ΠΏΠΈΡ‚Π΅ ΡΠΊΡ€ΠΈΠ½ΡˆΠΎΡ‚Ρ‹, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠ±ΡŠΡΡΠ½ΠΈΡ‚ΡŒ Π²Π°ΡˆΡƒ ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΡƒ. **Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ контСкст** -Π”ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ сюда любой Π΄Ρ€ΡƒΠ³ΠΎΠΉ контСкст ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΡ‹. \ No newline at end of file +Π”ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ сюда любой Π΄Ρ€ΡƒΠ³ΠΎΠΉ контСкст. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/configuration_issues.md b/.github/ISSUE_TEMPLATE/configuration_issues.md index fd9ef60..75fbdbe 100644 --- a/.github/ISSUE_TEMPLATE/configuration_issues.md +++ b/.github/ISSUE_TEMPLATE/configuration_issues.md @@ -1,14 +1,15 @@ --- -name: 🧰 Configuration issues -about: Π Π°Π·Π»ΠΈΡ‡Π½Ρ‹Π΅ прСдлоТСния ΠΏΠΎ настройкС ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° -title: '[CONFIGURATION] ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Π½ΠΎΠ²ΠΎΠΉ ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ.' -labels: 'type: configuration, status: backlog, priority: low' -assignees: 'SmithyVL' - +name: 🧰 ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ +about: Π Π°Π·Π»ΠΈΡ‡Π½Ρ‹Π΅ прСдлоТСния ΠΏΠΎ настройкС ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° ΠΈ сСрвисов Π²Π½ΡƒΡ‚Ρ€ΠΈ Π½Π΅Π³ΠΎ +title: "ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: configuration"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ** -Π§Π΅Ρ‚ΠΊΠΎΠ΅ ΠΈ ΠΊΡ€Π°Ρ‚ΠΊΠΎΠ΅ описаниС Ρ‚ΠΎΠ³ΠΎ, Ρ‡Ρ‚ΠΎ Π²Ρ‹ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΎΠΈΠ·ΠΎΡˆΠ»ΠΎ. +Π§Π΅Ρ‚ΠΊΠΎΠ΅ ΠΈ ΠΊΡ€Π°Ρ‚ΠΊΠΎΠ΅ описаниС Ρ‚ΠΎΠ³ΠΎ, Ρ‡Ρ‚ΠΎ Π²Ρ‹ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅, Ρ‡Ρ‚ΠΎΠ±Ρ‹ добавилось. **ΠžΠΏΠΈΡˆΠΈΡ‚Π΅ Π°Π»ΡŒΡ‚Π΅Ρ€Π½Π°Ρ‚ΠΈΠ²Π½Ρ‹Π΅ Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Ρ‹** Π§Π΅Ρ‚ΠΊΠΎΠ΅ ΠΈ ΠΊΡ€Π°Ρ‚ΠΊΠΎΠ΅ описаниС Π»ΡŽΠ±Ρ‹Ρ… Π°Π»ΡŒΡ‚Π΅Ρ€Π½Π°Ρ‚ΠΈΠ²Π½Ρ‹Ρ… Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΉ ΠΈΠ»ΠΈ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π²Ρ‹ рассмотрСли. diff --git a/.github/ISSUE_TEMPLATE/docs_issues.md b/.github/ISSUE_TEMPLATE/docs_issues.md index 51814f4..0563eb8 100644 --- a/.github/ISSUE_TEMPLATE/docs_issues.md +++ b/.github/ISSUE_TEMPLATE/docs_issues.md @@ -1,10 +1,11 @@ --- -name: πŸ“– Docs issues +name: πŸ“– ДокумСнтация about: Π£Π»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΡ ΠΈΠ»ΠΈ дополнСния ΠΊ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ -title: '[DOCS] ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚ ΠΏΠΎ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π½ΠΎΠΉ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ.' -labels: 'type: documentation, status: backlog, priority: low' -assignees: 'SmithyVL' - +title: "ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: documentation"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ffdc2dd..ab85b71 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,10 +1,11 @@ --- -name: πŸš€ Feature request +name: πŸš€ Новая Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ about: ΠŸΡ€Π΅Π΄Π»ΠΎΠΆΠΈΡ‚Π΅ идСю для этого ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° -title: '[FEATURE] ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ.' -labels: 'type: feature, status: backlog, priority: low' -assignees: 'SmithyVL' - +title: "ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: feature"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ** diff --git a/.github/ISSUE_TEMPLATE/refactoring_issues.md b/.github/ISSUE_TEMPLATE/refactoring_issues.md index 8717f8a..1537631 100644 --- a/.github/ISSUE_TEMPLATE/refactoring_issues.md +++ b/.github/ISSUE_TEMPLATE/refactoring_issues.md @@ -1,10 +1,11 @@ --- -name: 🧾 Refactoring issues +name: 🧾 Π Π΅Ρ„Π°ΠΊΡ‚ΠΎΡ€ΠΈΠ½Π³ about: ΠžΠΏΡ‚ΠΈΠΌΠΈΠ·Π°Ρ†ΠΈΡ, ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΠ΅ ΠΈ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠΎΠ΄Π° -title: '[REFACTORING] ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚ ΠΏΠΎ Ρ€Π΅Ρ„Π°ΠΊΡ‚ΠΎΡ€ΠΈΠ½Π³Ρƒ.' -labels: 'type: refactoring, status: backlog, priority: low' -assignees: 'SmithyVL' - +title: "ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: refactoring"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС Ρ€Π΅Ρ„Π°ΠΊΡ‚ΠΎΡ€ΠΈΠ½Π³Π°** diff --git a/.github/ISSUE_TEMPLATE/testing_issues.md b/.github/ISSUE_TEMPLATE/testing_issues.md index 2608180..0bd8c97 100644 --- a/.github/ISSUE_TEMPLATE/testing_issues.md +++ b/.github/ISSUE_TEMPLATE/testing_issues.md @@ -1,10 +1,11 @@ --- -name: πŸ§ͺ Testing issues +name: πŸ§ͺ ВСстированиС about: ВСстированиС ΠΊΠΎΠ΄Π° -title: '[TESTING] ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚ ΠΏΠΎ Ρ‚Π΅ΡΡ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡŽ.' -labels: 'type: testing, status: backlog, priority: low' -assignees: 'SmithyVL' - +title: "ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅" +labels: ["type: testing"] +projects: ["HogwartsSchoolOfMagic/projects/2"] +assignees: + - SmithyVL --- **ОписаниС кСйса для тСстирования** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 508df18..a9950ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,6 @@ name: CI on: workflow_dispatch: - #push: - # branches: - # - master pull_request: types: [ opened, synchronize, reopened ] @@ -14,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - name: πŸ“¦ Checkout - uses: actions/checkout@v3 - - name: β˜•οΈ Установка JDK 17 - uses: actions/setup-java@v3 + uses: actions/checkout@v4 + - name: β˜•οΈ Установка JDK 21 + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: "temurin" cache: 'gradle' - name: πŸ”“ Установка Ρ€Π°Π·Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΉ Π½Π° gradlew @@ -31,11 +28,11 @@ jobs: runs-on: ubuntu-latest steps: - name: πŸ“¦ Checkout - uses: actions/checkout@v3 - - name: β˜•οΈ Установка JDK 17 - uses: actions/setup-java@v3 + uses: actions/checkout@v4 + - name: β˜•οΈ Установка JDK 21 + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: "temurin" cache: 'gradle' - name: πŸ”“ Установка Ρ€Π°Π·Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΉ Π½Π° gradlew @@ -48,19 +45,19 @@ jobs: runs-on: ubuntu-latest steps: - name: πŸ“¦ Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: β˜•οΈ Установка JDK 17 - uses: actions/setup-java@v3 + - name: β˜•οΈ Установка JDK 21 + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: "temurin" cache: 'gradle' - name: πŸ”“ Установка Ρ€Π°Π·Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΉ Π½Π° gradlew run: chmod +x ./gradlew - name: πŸ“’ ΠšΡΡˆΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ SonarCloud - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index f126ade..45d71dc 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -14,6 +14,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8ff09bd..7c7b760 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,18 @@ ### Indellij Idea ### **.iml -.idea/ +.idea/git_toolbox_blame.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/kotlinc.xml +.idea/ktlint-plugin.xml +.idea/misc.xml +.idea/workspace.xml +.idea/.gitignore +.idea/inspectionProfiles/ +.idea/gradle.xml +.idea/sonarlint.xml +.idea/vcs.xml +.idea/git_toolbox_prj.xml ### Gradle ### **/.gradle/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..baeacf2 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..20e311c --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 0000000..138d328 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,155 @@ + \ No newline at end of file diff --git a/.idea/runConfigurations/ProtegoTotalumBotApp.xml b/.idea/runConfigurations/ProtegoTotalumBotApp.xml new file mode 100644 index 0000000..df50123 --- /dev/null +++ b/.idea/runConfigurations/ProtegoTotalumBotApp.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/assemble.xml b/.idea/runConfigurations/assemble.xml new file mode 100644 index 0000000..9e9bfd3 --- /dev/null +++ b/.idea/runConfigurations/assemble.xml @@ -0,0 +1,37 @@ + + + + + + + true + true + + + + + false + false + + + \ No newline at end of file diff --git a/.idea/runConfigurations/ktlintCheck.xml b/.idea/runConfigurations/ktlintCheck.xml new file mode 100644 index 0000000..ee7a8ec --- /dev/null +++ b/.idea/runConfigurations/ktlintCheck.xml @@ -0,0 +1,24 @@ + + + + + + + true + true + false + false + + + \ No newline at end of file diff --git a/.run/assemble.run.xml b/.run/assemble.run.xml deleted file mode 100644 index 3d8d7a3..0000000 --- a/.run/assemble.run.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - true - true - - - - - false - - - \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index e408836..0000000 --- a/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -
-

- LeoBot для Discord -

-
- -
- last-commit - time-with-code - ci - sonar-code-lines - sonar-quality-gate-status -
- -### πŸ“– ОписаниС - -___ -Пока Π½Π΅ написано - -### πŸ“‹ Π˜Π½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΠΈ ΠΏΠΎ запуску - -___ -Пока Π½Π΅ написано - -### βš™ Π’ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ - -___ -Пока Π½Π΅ написано - -### πŸ”¨ Π‘Ρ‚Π΅ΠΊ Ρ‚Π΅Ρ…Π½ΠΎΠ»ΠΎΠ³ΠΈΠΉ - -___ -Пока Π½Π΅ написано - -### 🎫 ЛицСнзия - -___ - -**[Apache License Version 2.0](https://github.com/HogwartsSchoolOfMagic/ConfigurationService/blob/master/LICENSE)** - -_Copyright Β©2023, Владислав [[SmithyVL]](https://github.com/SmithyVL) ΠšΡƒΠ·Π½Π΅Ρ†ΠΎΠ²_ \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 1cf68c9..920177b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { sonarqube { properties { - property("sonar.projectKey", "HogwartsSchoolOfMagic_DiscordLeoBot") + property("sonar.projectKey", "HogwartsSchoolOfMagic_ProtegoTotalumBot") property("sonar.organization", "hogwarts-school-of-magic") property("sonar.host.url", "https://sonarcloud.io") } @@ -43,4 +43,4 @@ subprojects { configure { debug.set(true) } -} \ No newline at end of file +} diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt similarity index 78% rename from buildSrc/src/main/kotlin/dependencies.kt rename to buildSrc/src/main/kotlin/Dependencies.kt index 16a87ce..fd4d58f 100644 --- a/buildSrc/src/main/kotlin/dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -2,24 +2,24 @@ * ΠšΠΎΠ½ΡΡ‚Π°Π½Ρ‚Ρ‹ с названиями Π³Ρ€ΡƒΠΏΠΏ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ. */ object Groups { - /* Spring */ + // Spring const val SPRING_BOOT = "org.springframework.boot" - /* Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… */ + // Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… const val POSTGRES = "org.postgresql" const val LIQUIBASE = "org.liquibase" - const val R2DBC = "io.r2dbc" + const val R2DBC = "org.postgresql" - /* Reactor */ + // Reactor const val NETTY = "io.netty" - /* Discord */ + // Discord const val KORD = "dev.kord" - /* БСриализация */ + // БСриализация const val JACKSON = "com.fasterxml.jackson.module" - /* Kotlin */ + // Kotlin const val KTX = "org.jetbrains.kotlinx" const val REACTOR_KT = "io.projectreactor.kotlin" const val KT = "org.jetbrains.kotlin" @@ -29,24 +29,24 @@ object Groups { * ΠšΠΎΠ½ΡΡ‚Π°Π½Ρ‚Ρ‹ с названиями Π°Ρ€Ρ‚Π΅Ρ„Π°ΠΊΡ‚ΠΎΠ² Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ. */ object Artifacts { - /* Spring */ + // Spring const val SPRING_BOOT = "spring-boot" const val SPRING_BOOT_STARTER = "${SPRING_BOOT}-starter" const val SPRING_BOOT_DATA_R2DBC = "${SPRING_BOOT}-starter-data-r2dbc" const val SPRING_BOOT_DATA_WEBFLUX = "${SPRING_BOOT}-starter-webflux" - /* Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… */ + // Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… const val POSTGRES = "postgresql" const val LIQUIBASE = "liquibase-core" const val PG_R2DBC = "r2dbc-postgresql" - /* Reactor */ + // Reactor const val NETTY_CODEC = "netty-codec-http" - /* Discord */ + // Discord const val KORD_CORE = "kord-core" - /* Kotlin */ + // Kotlin const val KTX_REACTOR = "kotlinx-coroutines-reactor" const val JACKSON_KT = "jackson-module-kotlin" const val REACTOR_KT_EXT = "reactor-kotlin-extensions" @@ -57,48 +57,48 @@ object Artifacts { * ΠšΠΎΠ½ΡΡ‚Π°Π½Ρ‚Ρ‹ с вСрсиями Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ. */ object Versions { - /* Spring */ - const val SPRING_BOOT = "3.0.4" + // Spring + const val SPRING_BOOT = "3.3.1" - /* Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… */ - const val PG_R2DBC = "0.8.13.RELEASE" + // Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… + const val PG_R2DBC = "1.0.5.RELEASE" - /* Reactor */ - const val NETTY_CODEC = "4.1.89.Final" + // Reactor + const val NETTY_CODEC = "4.1.111.Final" - /* Discord */ - const val KORD_CORE = "0.8.0-M17" + // Discord + const val KORD_CORE = "0.14.0" - /* Kotlin */ - const val KT = "1.8.10" - const val KT_LINT = "11.3.1" + // Kotlin + const val KT = "1.9.22" + const val KT_LINT = "12.1.1" - /* Sonar */ - const val SONAR = "3.5.0.2730" + // Sonar + const val SONAR = "5.0.0.4638" } /** * ΠšΠΎΠ½ΡΡ‚Π°Π½Ρ‚Ρ‹ с ΠΏΠΎΠ»Π½Ρ‹ΠΌ ΠΈΠΌΠ΅Π½Π΅ΠΌ ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌΠΎΠΉ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ. */ object Libs { - /* Spring */ + // Spring const val SPRING_BOOT = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT}" const val SPRING_BOOT_STARTER = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_STARTER}" const val SPRING_BOOT_DATA_R2DBC = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_DATA_R2DBC}" const val SPRING_BOOT_DATA_WEBFLUX = "${Groups.SPRING_BOOT}:${Artifacts.SPRING_BOOT_DATA_WEBFLUX}" - /* Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… */ + // Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… const val PG_R2DBC = "${Groups.R2DBC}:${Artifacts.PG_R2DBC}:${Versions.PG_R2DBC}" const val POSTGRES = "${Groups.POSTGRES}:${Artifacts.POSTGRES}" const val LIQUIBASE = "${Groups.LIQUIBASE}:${Artifacts.LIQUIBASE}" - /* Discord */ + // Discord const val KORD_CORE = "${Groups.KORD}:${Artifacts.KORD_CORE}:${Versions.KORD_CORE}" - /* Reactor */ + // Reactor const val NETTY_CODEC = "${Groups.NETTY}:${Artifacts.NETTY_CODEC}:${Versions.NETTY_CODEC}" - /* Kotlin */ + // Kotlin const val KOTLINX_REACTOR = "${Groups.KTX}:${Artifacts.KTX_REACTOR}" const val JACKSON_KT = "${Groups.JACKSON}:${Artifacts.JACKSON_KT}" const val REACTOR_KT_EXT = "${Groups.REACTOR_KT}:${Artifacts.REACTOR_KT_EXT}" @@ -109,18 +109,18 @@ object Libs { * ΠšΠΎΠ½ΡΡ‚Π°Π½Ρ‚Ρ‹ с названиями ΠΏΠ»Π°Π³ΠΈΠ½ΠΎΠ². */ object Plugins { - /* Spring */ + // Spring const val SPRING_ALIAS = "plugin.spring" const val SPRING = "${Groups.KT}.${SPRING_ALIAS}" const val SPRING_BOOT = Groups.SPRING_BOOT const val SPRING_DEPS = "io.spring.dependency-management" - /* Kotlin */ + // Kotlin const val JVM = "jvm" const val KT = "kotlin" const val KT_LINT = "org.jlleitschuh.gradle.ktlint" - /* Sonar */ + // Sonar const val SONAR = "org.sonarqube" } @@ -129,7 +129,7 @@ object Plugins { */ object Common { const val PROJECT_GROUP = "io.github.hogwartsschoolofmagic" - const val PROJECT_VERSION = "2023.1" - const val JDK_VERSION = "17" + const val PROJECT_VERSION = "0.0.1-SNAPSHOT" + const val JDK_VERSION = "21" const val JSR305 = "-Xjsr305=strict" -} \ No newline at end of file +} diff --git a/dlb-discord/Dockerfile b/dlb-discord/Dockerfile deleted file mode 100644 index 2a06283..0000000 --- a/dlb-discord/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM eclipse-temurin:17-jdk-alpine -MAINTAINER Vladislav Kuznetsov -VOLUME /tmp -ADD build/libs/dlb-discord-2023.1.jar discord-leo-bot.jar -EXPOSE 8080 -ENTRYPOINT ["java", "-jar", "discord-leo-bot.jar"] \ No newline at end of file diff --git a/docker/.env b/docker/.env index 5aed45c..17fa423 100644 --- a/docker/.env +++ b/docker/.env @@ -1 +1 @@ -COMPOSE_PROJECT_NAME = leo-bot \ No newline at end of file +COMPOSE_PROJECT_NAME = protego-totalum-bot \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ff2ce52..4b7ee41 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,10 +1,3 @@ -version: "3.9" - -networks: - leo-network: - name: $APPLICATION_NAME-network - external: false - services: database: container_name: $APPLICATION_NAME-postgres @@ -18,22 +11,27 @@ services: POSTGRES_USER: $PG_USER POSTGRES_PASSWORD: $PG_PASSWORD networks: - - leo-network - leo-bot: + - protego-totalum-network + protego-totalum-bot: container_name: $APPLICATION_NAME-bot depends_on: - database build: - context: ../dlb-discord + context: ../pt-discord dockerfile: ./Dockerfile ports: - "8080:8080" command: - - discord-leo-bot.jar + - protego-totalum-bot.jar environment: - LEO_DB_HOST: database - LEO_DB_PORT: 5432 + PROTEGO_TOTALUM_DB_HOST: database + PROTEGO_TOTALUM_DB_PORT: 5432 networks: - - leo-network + - protego-totalum-network env_file: - - ignore.env \ No newline at end of file + - ignore.env + +networks: + protego-totalum-network: + name: $APPLICATION_NAME-network + external: false \ No newline at end of file diff --git a/docker/env.bat b/docker/env.bat index fded3fa..c47d00a 100644 --- a/docker/env.bat +++ b/docker/env.bat @@ -1,6 +1,6 @@ -set APPLICATION_NAME=leo +set APPLICATION_NAME=protego-totalum -set PG_DBNAME=leo_db -set PG_USER=leo_login -set PG_PASSWORD=leo_password +set PG_DBNAME=protego_totalum +set PG_USER=protego_totalum +set PG_PASSWORD=protego_totalum set PG_PORT=5123 \ No newline at end of file diff --git a/docker/postgres/create_schemas.sql b/docker/postgres/create_schemas.sql index 39b0c1c..b1b558e 100644 --- a/docker/postgres/create_schemas.sql +++ b/docker/postgres/create_schemas.sql @@ -1,2 +1,3 @@ -\connect leo_db -create schema if not exists leo_bot_schema; \ No newline at end of file +\connect protego_totalum +create schema if not exists protego_totalum; +create schema if not exists liquibase; \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..17cccfd --- /dev/null +++ b/docs/README.md @@ -0,0 +1,43 @@ + +
+

+ + Discord Π±ΠΎΡ‚ гильдии "Protego Totalum" + +

+
+ +
+ last-commit + ci + sonar-code-lines + sonar-quality-gate-status +
+ +### πŸ“– ОписаниС + +___ +Пока Π½Π΅ написано + +### πŸ“‹ Π˜Π½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΠΈ ΠΏΠΎ запуску + +___ +Пока Π½Π΅ написано + +### βš™ Π’ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ + +___ +Пока Π½Π΅ написано + +### πŸ”¨ Π‘Ρ‚Π΅ΠΊ Ρ‚Π΅Ρ…Π½ΠΎΠ»ΠΎΠ³ΠΈΠΉ + +___ +Пока Π½Π΅ написано + +### 🎫 ЛицСнзия + +___ + +**[Apache License Version 2.0](https://github.com/HogwartsSchoolOfMagic/ConfigurationService/blob/master/LICENSE)** + +_Copyright Β©2023, Владислав [[SmithyVL]](https://github.com/SmithyVL) ΠšΡƒΠ·Π½Π΅Ρ†ΠΎΠ²_ \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 774fae8..48c0a02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/dlb-util/build.gradle.kts b/pt-common/build.gradle.kts similarity index 89% rename from dlb-util/build.gradle.kts rename to pt-common/build.gradle.kts index 1a705be..e5ed201 100644 --- a/dlb-util/build.gradle.kts +++ b/pt-common/build.gradle.kts @@ -7,6 +7,6 @@ tasks.findByName("bootJar")?.apply { } dependencies { - /* Spring */ + // Spring compileOnly(Libs.SPRING_BOOT) } diff --git a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt similarity index 62% rename from dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt rename to pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt index f214b9c..b63bfe1 100644 --- a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt +++ b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/annotation/YamlPropertySource.kt @@ -11,18 +11,10 @@ import kotlin.reflect.KClass */ @PropertySource annotation class YamlPropertySource( - @get: AliasFor(annotation = PropertySource::class) + @get:AliasFor(annotation = PropertySource::class) val name: String = "", - - @get: AliasFor(annotation = PropertySource::class) + @get:AliasFor(annotation = PropertySource::class) val value: Array = [], - - @get: AliasFor(annotation = PropertySource::class) - val ignoreResourceNotFound: Boolean = false, - - @get: AliasFor(annotation = PropertySource::class) - val encoding: String = "", - - @get: AliasFor(annotation = PropertySource::class) - val factory: KClass = YamlPropertySourceFactory::class + @get:AliasFor(annotation = PropertySource::class) + val factory: KClass = YamlPropertySourceFactory::class, ) diff --git a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt similarity index 63% rename from dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt rename to pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt index 28b549f..aebcb0d 100644 --- a/dlb-util/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt +++ b/pt-common/src/main/kotlin/io/github/hogwartsschoolofmagic/factory/YamlPropertySourceFactory.kt @@ -9,6 +9,11 @@ import org.springframework.core.io.support.PropertySourceFactory * Π€Π°Π±Ρ€ΠΈΠΊΠ° для Π·Π°Π³Ρ€ΡƒΠ·ΠΊΠΈ Ρ„Π°ΠΉΠ»ΠΎΠ² ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π° yml/yaml. */ internal class YamlPropertySourceFactory : PropertySourceFactory { - override fun createPropertySource(name: String?, resource: EncodedResource): PropertySource<*> = - YamlPropertySourceLoader().load(name ?: resource.resource.description, resource.resource).first() + override fun createPropertySource( + name: String?, + resource: EncodedResource, + ): PropertySource<*> = + resource.resource.let { innerRes -> + YamlPropertySourceLoader().load(name ?: innerRes.description, innerRes).first() + } } diff --git a/dlb-database/build.gradle.kts b/pt-database/build.gradle.kts similarity index 54% rename from dlb-database/build.gradle.kts rename to pt-database/build.gradle.kts index f963ecc..4fb65ba 100644 --- a/dlb-database/build.gradle.kts +++ b/pt-database/build.gradle.kts @@ -7,11 +7,11 @@ tasks.findByName("bootJar")?.apply { } dependencies { - /* Spring */ + // Зависимости, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹Π΅ ΠΏΡ€ΠΈ запускС прилоТСния. + // Spring. runtimeOnly(Libs.SPRING_BOOT_STARTER) - /* Π‘Π°Π·Π° Π΄Π°Π½Π½Ρ‹Ρ… */ - implementation(Libs.SPRING_BOOT_DATA_R2DBC) + // Π‘Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ…. runtimeOnly(Libs.POSTGRES) runtimeOnly(Libs.LIQUIBASE) runtimeOnly(Libs.PG_R2DBC) { @@ -19,9 +19,13 @@ dependencies { } runtimeOnly(Libs.NETTY_CODEC) - /* Kotlin */ + // Зависимости, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹Π΅ ΠΏΡ€ΠΈ компиляции прилоТСния. + // Π‘Π°Π·Π° Π΄Π°Π½Π½Ρ‹Ρ…. + implementation(Libs.SPRING_BOOT_DATA_R2DBC) + + // Kotlin. implementation(Libs.KOTLINX_REACTOR) - /* ΠŸΡ€ΠΎΠ΅ΠΊΡ‚Π½Ρ‹Π΅ ΠΌΠΎΠ΄ΡƒΠ»ΠΈ */ - implementation(project(":dlb-util")) + // ΠŸΡ€ΠΎΠ΅ΠΊΡ‚Π½Ρ‹Π΅ ΠΌΠΎΠ΄ΡƒΠ»ΠΈ. + implementation(project(":pt-common")) } diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt similarity index 100% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DatabaseAutoConfiguration.kt diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt similarity index 95% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt index 8491d6a..54802ed 100644 --- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt +++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/CommandsEntity.kt @@ -20,5 +20,5 @@ data class CommandsEntity( val serverDiscordId: Long, val name: String, val description: String?, - val isActive: Boolean? = true + val isActive: Boolean? = true, ) diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt similarity index 94% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt index 5a68424..f42e957 100644 --- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt +++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/model/ServersEntity.kt @@ -16,5 +16,5 @@ data class ServersEntity( @Id val id: Long? = null, val discordId: Long, val premiumLevel: Long? = 0, - val isDeleted: Boolean? = false + val isDeleted: Boolean? = false, ) diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt similarity index 85% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt index e8c5871..e4750e0 100644 --- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt +++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/CommandsRepository.kt @@ -17,5 +17,8 @@ internal interface CommandsRepository : CoroutineCrudRepository + fun findByDiscordIdAndServerDiscordId( + commandDiscordId: Long, + serverDiscordId: Long, + ): Flow } diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt similarity index 100% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/persistence/repo/ServersRepository.kt diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt similarity index 77% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt index d355b07..19396ad 100644 --- a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt +++ b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/CommandsService.kt @@ -22,9 +22,12 @@ class CommandsService { * @param serverDiscordId ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ сСрвСра Π² Discord. * @return TRUE, Ссли ΠΊΠΎΠΌΠ°Π½Π΄Π° Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π° ΠΈΠ»ΠΈ Π°ΠΊΡ‚ΠΈΠ²Π½Π°, ΠΈΠ½Π°Ρ‡Π΅ FALSE. */ - fun isActiveCommand(commandDiscordId: Long, serverDiscordId: Long) = - commandsRepo.findByDiscordIdAndServerDiscordId(commandDiscordId, serverDiscordId) - .take(1) - .map { it.isActive == true } - .onEmpty { emit(true) } + fun isActiveCommand( + commandDiscordId: Long, + serverDiscordId: Long, + ) = commandsRepo + .findByDiscordIdAndServerDiscordId(commandDiscordId, serverDiscordId) + .take(1) + .map { it.isActive == true } + .onEmpty { emit(true) } } diff --git a/dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt b/pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt similarity index 100% rename from dlb-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt rename to pt-database/src/main/kotlin/io/github/hogwartsschoolofmagic/service/ServersService.kt diff --git a/dlb-database/src/main/resources/META-INF/spring.factories b/pt-database/src/main/resources/META-INF/spring.factories similarity index 100% rename from dlb-database/src/main/resources/META-INF/spring.factories rename to pt-database/src/main/resources/META-INF/spring.factories diff --git a/dlb-database/src/main/resources/database.yml b/pt-database/src/main/resources/database.yml similarity index 100% rename from dlb-database/src/main/resources/database.yml rename to pt-database/src/main/resources/database.yml diff --git a/pt-discord/Dockerfile b/pt-discord/Dockerfile new file mode 100644 index 0000000..c3de601 --- /dev/null +++ b/pt-discord/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:21 +USER 65534 +LABEL org.opencontainers.image.authors="Vladislav Kuznetsov " +VOLUME /tmp +ADD build/libs/pt-discord-0.0.1-SNAPSHOT.jar protego-totalum-bot.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "protego-totalum-bot.jar"] \ No newline at end of file diff --git a/dlb-discord/build.gradle.kts b/pt-discord/build.gradle.kts similarity index 59% rename from dlb-discord/build.gradle.kts rename to pt-discord/build.gradle.kts index debba73..e6fe11b 100644 --- a/dlb-discord/build.gradle.kts +++ b/pt-discord/build.gradle.kts @@ -3,18 +3,18 @@ plugins { } dependencies { - /* Основная Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° для Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Discord API */ + // Основная Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° для Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Discord API implementation(Libs.KORD_CORE) - /* Spring */ + // Spring implementation(Libs.SPRING_BOOT_DATA_WEBFLUX) - /* Kotlin */ + // Kotlin implementation(Libs.JACKSON_KT) implementation(Libs.REACTOR_KT_EXT) implementation(Libs.KT_REFLECT) implementation(Libs.KOTLINX_REACTOR) - /* ΠŸΡ€ΠΎΠ΅ΠΊΡ‚Π½Ρ‹Π΅ ΠΌΠΎΠ΄ΡƒΠ»ΠΈ */ - implementation(project(":dlb-database")) + // ΠŸΡ€ΠΎΠ΅ΠΊΡ‚Π½Ρ‹Π΅ ΠΌΠΎΠ΄ΡƒΠ»ΠΈ + implementation(project(":pt-database")) } diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt similarity index 100% rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/LeoBotApp.kt diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt similarity index 100% rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/Command.kt diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt similarity index 73% rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt index d9ba293..766c7b5 100644 --- a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt +++ b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/command/PlusCommand.kt @@ -4,7 +4,7 @@ import dev.kord.core.Kord import dev.kord.core.behavior.interaction.response.respond import dev.kord.core.event.interaction.GuildChatInputCommandInteractionCreateEvent import dev.kord.core.on -import dev.kord.rest.builder.interaction.int +import dev.kord.rest.builder.interaction.integer import org.springframework.stereotype.Component /** @@ -18,10 +18,10 @@ class PlusCommand : Command() { override suspend fun create(kord: Kord) { kord.createGlobalChatInputCommand(getName(), getDescription()) { - int(ARG1_NAME, ARG1_DESC) { + integer(ARG1_NAME, ARG1_DESC) { required = true } - int(ARG2_NAME, ARG2_DESC) { + integer(ARG2_NAME, ARG2_DESC) { required = true } } @@ -36,9 +36,13 @@ class PlusCommand : Command() { commandsService.isActiveCommand(commandDiscordId, serverDiscordId) .collect { if (it) { - val first = command.integers[ARG1_NAME]!! - val second = command.integers[ARG2_NAME]!! - response.respond { content = "$first + $second = ${first + second}" } + val first = command.integers.getOrDefault(ARG1_NAME, null) + val second = command.integers.getOrDefault(ARG2_NAME, null) + if (first != null && second != null) { + response.respond { content = "$first + $second = ${first.plus(second)}" } + } else { + response.respond { content = "Один ΠΈΠ· ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ² Π½Π΅ ΠΏΠ΅Ρ€Π΅Π΄Π°Π½" } + } } else { response.respond { content = "Команда: ${command.data.name} Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½Π° для этого сСрвСра!" } } diff --git a/dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt b/pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt similarity index 100% rename from dlb-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt rename to pt-discord/src/main/kotlin/io/github/hogwartsschoolofmagic/config/DiscordConfig.kt diff --git a/dlb-discord/src/main/resources/application.yml b/pt-discord/src/main/resources/application.yml similarity index 100% rename from dlb-discord/src/main/resources/application.yml rename to pt-discord/src/main/resources/application.yml diff --git a/dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml b/pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml similarity index 100% rename from dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml rename to pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-create_tables.yaml diff --git a/dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml b/pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml similarity index 100% rename from dlb-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml rename to pt-discord/src/main/resources/db/changelog/2023.1/db.2023.1-master.yaml diff --git a/dlb-discord/src/main/resources/db/changelog/db.changelog-master.yaml b/pt-discord/src/main/resources/db/changelog/db.changelog-master.yaml similarity index 100% rename from dlb-discord/src/main/resources/db/changelog/db.changelog-master.yaml rename to pt-discord/src/main/resources/db/changelog/db.changelog-master.yaml diff --git a/settings.gradle.kts b/settings.gradle.kts index be240ab..4f35a8a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,7 @@ -rootProject.name = "DiscordLeoBot" +rootProject.name = "ProtegoTotalumBot" include( - "dlb-util", - "dlb-database", - "dlb-discord" -) \ No newline at end of file + "pt-common", + "pt-database", + "pt-discord", +)