mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-02 23:57:17 +00:00
Compare commits
116 Commits
sissi-1.4.
...
sissi-1.4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed9bf49e19 | ||
|
|
8fe46f6172 | ||
|
|
1bc47d962e | ||
|
|
b9ce6f22a7 | ||
|
|
45b8c3c588 | ||
|
|
ba5f34d667 | ||
|
|
1f5ed1b623 | ||
|
|
170588d638 | ||
|
|
4d69a90d5d | ||
|
|
19ed221329 | ||
|
|
5ba3036e1d | ||
|
|
25a4d47dc0 | ||
|
|
3347fdd8f1 | ||
|
|
47eef33850 | ||
|
|
583a49df5b | ||
|
|
ca938a0164 | ||
|
|
e22f94ff1e | ||
|
|
307c9eac67 | ||
|
|
6002c979d9 | ||
|
|
df49c313a4 | ||
|
|
68bf6b5062 | ||
|
|
29eb743c35 | ||
|
|
03f9b64db2 | ||
|
|
212bc09d90 | ||
|
|
e1f327a687 | ||
|
|
7af0d2db1c | ||
|
|
b4f740fcf6 | ||
|
|
dda7ed7db8 | ||
|
|
af006ee880 | ||
|
|
125febc02a | ||
|
|
13f92247cf | ||
|
|
79ed55d988 | ||
|
|
7bc04a7906 | ||
|
|
89d743987d | ||
|
|
32ddd4e6f0 | ||
|
|
68afc31b2e | ||
|
|
d0ba46c440 | ||
|
|
554d197ca4 | ||
|
|
8826796fcb | ||
|
|
c8ed0e2195 | ||
|
|
25d19bfa26 | ||
|
|
f7e19b580e | ||
|
|
5f6bd0d88e | ||
|
|
a110c54411 | ||
|
|
a4a729dfc2 | ||
|
|
85eee4835f | ||
|
|
cab11140fa | ||
|
|
5854ca2ba7 | ||
|
|
3f613eeddf | ||
|
|
5fda777a62 | ||
|
|
e447eca9dd | ||
|
|
17e2e09541 | ||
|
|
1ea2cc02c8 | ||
|
|
3a1071b65e | ||
|
|
32274561e9 | ||
|
|
b3550549de | ||
|
|
eef245ede0 | ||
|
|
6ac950358f | ||
|
|
01c59f5059 | ||
|
|
be0325deb9 | ||
|
|
f8d84ff943 | ||
|
|
5ec3b3a1f4 | ||
|
|
fef1a5f0ae | ||
|
|
db89b59600 | ||
|
|
3ca37c448d | ||
|
|
b6a416135a | ||
|
|
ed181a2bc3 | ||
|
|
2ee2cb18f5 | ||
|
|
d0908e7315 | ||
|
|
7c6809500a | ||
|
|
a6e3f2df17 | ||
|
|
6b35a75539 | ||
|
|
32ed3bff5d | ||
|
|
30765ee80a | ||
|
|
91a1807abe | ||
|
|
2567c139ae | ||
|
|
1f141d53de | ||
|
|
0bd1e7d120 | ||
|
|
927f0f8ab2 | ||
|
|
c2df483301 | ||
|
|
90c36cc506 | ||
|
|
376a34fc2e | ||
|
|
5ed0c89014 | ||
|
|
2351787221 | ||
|
|
ca6e64832a | ||
|
|
8334562e2b | ||
|
|
07b4de5df8 | ||
|
|
17933f9a22 | ||
|
|
12d564e5cd | ||
|
|
e097fbe0ef | ||
|
|
8639038be2 | ||
|
|
295abaf4cf | ||
|
|
de478506fc | ||
|
|
b0b3db0a44 | ||
|
|
ed5e4ea5a7 | ||
|
|
627229ebd9 | ||
|
|
f4300070b9 | ||
|
|
725a0c4f2c | ||
|
|
1fbeb880b7 | ||
|
|
7a327deab9 | ||
|
|
a1f0cf58b9 | ||
|
|
2e7caa80bb | ||
|
|
32e80a5b84 | ||
|
|
96a230f347 | ||
|
|
88a4d45d22 | ||
|
|
858317a7f4 | ||
|
|
b69c873efe | ||
|
|
c93be84aef | ||
|
|
a61a128236 | ||
|
|
a1b2700092 | ||
|
|
da7cc2f6a7 | ||
|
|
4cb118339f | ||
|
|
11460f1e19 | ||
|
|
c9b856b300 | ||
|
|
c513087d30 | ||
|
|
8a110215f1 |
4
.env
4
.env
@@ -1,4 +1,4 @@
|
||||
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
|
||||
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
|
||||
VERSION=1.4.37
|
||||
ABSTRACTO_VERSION=1.5.22
|
||||
VERSION=1.4.61
|
||||
ABSTRACTO_VERSION=1.5.50
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -14,7 +14,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
47
.github/workflows/release.yml
vendored
47
.github/workflows/release.yml
vendored
@@ -1,47 +0,0 @@
|
||||
name: Publish package to GitHub Packages
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Java for publishing to GitHub Packages
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
- name: Load current version
|
||||
id: version
|
||||
run: echo "version=$(mvn -s settings.xml --file pom.xml -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
|
||||
- name: Publish to GitHub Packages
|
||||
run: mvn -s settings.xml --file pom.xml -B deploy -Dmaven.wagon.http.pool=false -DskipTests=true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
user: Sheldan
|
||||
token: ${{ secrets.ABSTRACTO_PAT }}
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: harbor.sheldan.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
- name: Load env files
|
||||
id: dotenv
|
||||
uses: falti/dotenv-action@v1.0.4
|
||||
with:
|
||||
path: .env
|
||||
- name: Push container
|
||||
run: docker-compose build && docker-compose push
|
||||
env:
|
||||
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
|
||||
VERSION: ${{ steps.dotenv.outputs.version }}
|
||||
- name: Helm push
|
||||
working-directory: ./deployment/helm/
|
||||
run: |-
|
||||
helm registry login -u '${{ secrets.HARBOR_USERNAME }}' -p '${{ secrets.HARBOR_TOKEN }}' harbor.sheldan.dev
|
||||
helm package sissi
|
||||
helm push sissi*.tgz oci://harbor.sheldan.dev/sissi
|
||||
92
.github/workflows/release_manual.yaml
vendored
Normal file
92
.github/workflows/release_manual.yaml
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
name: Publishes a new version of Sissi
|
||||
on: workflow_dispatch
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
- name: Load current version
|
||||
id: version
|
||||
run: echo "version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec | cut -d- -f1)" >> $GITHUB_ENV
|
||||
- name: Create a Release
|
||||
uses: elgohr/Github-Release-Action@v5
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
title: Release of version ${{ env.version }}
|
||||
- name: Release maven packages
|
||||
uses: qcastel/github-actions-maven-release@v1.12.41
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk/
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
abstractoUser: Sheldan
|
||||
abstractoToken: ${{ secrets.ABSTRACTO_PAT }}
|
||||
with:
|
||||
git-release-bot-name: "release-bot"
|
||||
git-release-bot-email: "release-bot@sheldan.dev"
|
||||
release-branch-name: master
|
||||
maven-args: "-Dmaven.javadoc.skip=true -s settings.xml -DskipTests"
|
||||
access-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: harbor.sheldan.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
- name: Update Chart version file
|
||||
uses: fjogeleit/yaml-update-action@v0.13.2
|
||||
with:
|
||||
valueFile: 'deployment/helm/sissi/Chart.yaml'
|
||||
propertyPath: 'version'
|
||||
value: ${{ env.version }}
|
||||
commitChange: false
|
||||
- name: Update value files version
|
||||
uses: fjogeleit/yaml-update-action@v0.13.2
|
||||
with:
|
||||
valueFile: 'deployment/helm/sissi/values.yaml'
|
||||
commitChange: false
|
||||
changes: |
|
||||
{
|
||||
"bot.tag": "${{ env.version }}",
|
||||
"restApi.tag": "${{ env.version }}",
|
||||
"privateRestApi.tag": "${{ env.version }}",
|
||||
"templateDeploymentData.tag": "${{ env.version }}",
|
||||
"dbConfigDeploymentData.tag": "${{ env.version }}"
|
||||
}
|
||||
- name: Update .env version
|
||||
run:
|
||||
sed -i '3s/.*/VERSION=${{ env.version }}/' .env
|
||||
- name: Load env file
|
||||
id: dotenv
|
||||
uses: falti/dotenv-action@v1.0.4
|
||||
with:
|
||||
path: .env
|
||||
- name: Build and push Docker containers
|
||||
run: docker compose build && docker compose push
|
||||
env:
|
||||
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
|
||||
VERSION: ${{ steps.dotenv.outputs.version }}
|
||||
- name: Helm package and push
|
||||
working-directory: ./deployment/helm/
|
||||
run: |-
|
||||
helm registry login -u '${{ secrets.HARBOR_USERNAME }}' -p '${{ secrets.HARBOR_TOKEN }}' harbor.sheldan.dev
|
||||
helm package sissi
|
||||
helm push sissi*.tgz oci://harbor.sheldan.dev/sissi
|
||||
- name: Fix file permissions
|
||||
run:
|
||||
sudo chmod -R ugo+rwX . # https://github.com/actions/checkout/issues/164
|
||||
- name: Commit updated versions
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: "release-bot"
|
||||
author_email: "release-bot@sheldan.dev"
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -21,5 +21,9 @@ target/
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
Chart.lock
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*.tgz
|
||||
3
.tiltignore
Normal file
3
.tiltignore
Normal file
@@ -0,0 +1,3 @@
|
||||
*.tgz
|
||||
tilt/sissi-dev/tmpcharts/
|
||||
tilt/sissi-dev/charts/*.tgz
|
||||
5
Tiltfile
5
Tiltfile
@@ -18,7 +18,7 @@ local_resource(
|
||||
docker_build_with_restart(
|
||||
registry + 'sissi-bot',
|
||||
'./application/executable/target/jar',
|
||||
entrypoint=['java', '-noverify', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005', '-cp', '.:./lib/*', 'dev.sheldan.sissi.executable.Application'],
|
||||
entrypoint=['java', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005', '-cp', '.:./lib/*', 'dev.sheldan.sissi.executable.Application'],
|
||||
dockerfile='./application/executable/Dockerfile',
|
||||
live_update=[
|
||||
sync('./application/executable/target/jar/BOOT-INF/lib', '/app/lib'),
|
||||
@@ -38,7 +38,8 @@ docker_build(registry + 'sissi-private-rest-api', 'deployment/image-packaging/sr
|
||||
docker_build(registry + 'sissi-template-data', 'deployment/image-packaging/src/main/docker/template-data/')
|
||||
|
||||
|
||||
k8s_yaml(helm('deployment/helm/sissi', values=
|
||||
local('cd tilt/sissi-dev && helm dep up')
|
||||
k8s_yaml(helm('tilt/sissi-dev', values=
|
||||
['./../Sissi-environments/argocd/apps/sissi/values/local/values.yaml',
|
||||
'secrets://./../Sissi-environments/argocd/apps/sissi/values/local/values.secrets.yaml']
|
||||
))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
@@ -55,12 +55,13 @@
|
||||
<artifactId>metrics-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- modules containing commands -->
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.scheduling</groupId>
|
||||
<artifactId>scheduling-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- modules containing commands -->
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>link-embed-impl</artifactId>
|
||||
@@ -136,6 +137,11 @@
|
||||
<artifactId>statistic-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>sticky-roles-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>giveaway-impl</artifactId>
|
||||
@@ -160,6 +166,13 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.sissi.application.module</groupId>
|
||||
<artifactId>miepscord</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.sissi.application.module</groupId>
|
||||
<artifactId>rss-news</artifactId>
|
||||
|
||||
@@ -2,8 +2,8 @@ spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
|
||||
spring.datasource.username= ${DB_USER}
|
||||
spring.datasource.password= ${DB_PASS}
|
||||
spring.datasource.hikari.maximum-pool-size=${hikariPoolSize}
|
||||
spring.jpa.hibernate.default_schema=abstracto
|
||||
spring.jpa.properties.hibernate.default_schema=abstracto
|
||||
spring.jpa.hibernate.default_schema=${DB_SCHEMA}
|
||||
spring.jpa.properties.hibernate.default_schema=${DB_SCHEMA}
|
||||
spring.quartz.jdbc.initialize-schema=never
|
||||
management.metrics.tags.application=Sissi
|
||||
management.endpoint.health.probes.enabled=true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>image-generation-custom</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="feature.xml" relativeToChangelogFile="true"/>
|
||||
<include file="default_emote.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="moderation_custom_reaction_message_default_emote-insert">
|
||||
<insert tableName="default_emote">
|
||||
<column name="emote_key" value="reactionReport1"/>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="moderation_custom_feature-insertion">
|
||||
<insert tableName="feature">
|
||||
<column name="key" value="moderationCustom"/>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="moderationCustomFeature" value="(SELECT id FROM feature WHERE key = 'moderationCustom')"/>
|
||||
<property name="moderationModule" value="(SELECT id FROM module WHERE name = 'moderation')"/>
|
||||
<changeSet author="Sheldan" id="moderationCustom_modmode-commands">
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="default_emote.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="moderation_custom_reaction_message_question_mark_emote-insert">
|
||||
<insert tableName="default_emote">
|
||||
<column name="emote_key" value="reactionReport6"/>
|
||||
<column name="name" value="❓"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,8 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd">
|
||||
<include file="1.1.0/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.2.1/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.4.45/collection.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -2,7 +2,7 @@ abstracto.featureFlags.moderationCustom.featureName=moderationCustom
|
||||
abstracto.featureFlags.moderationCustom.enabled=false
|
||||
|
||||
abstracto.systemConfigs.reportReactionAmount.name=reportReactionAmount
|
||||
abstracto.systemConfigs.reportReactionAmount.longValue=5
|
||||
abstracto.systemConfigs.reportReactionAmount.longValue=7
|
||||
|
||||
abstracto.systemConfigs.modModeRoleId.name=modModeRoleId
|
||||
abstracto.systemConfigs.modModeRoleId.longValue=0
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>application</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="debraFeature" value="(SELECT id FROM feature WHERE key = 'debra')"/>
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="feature.xml" relativeToChangelogFile="true"/>
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="debra_feature-insertion">
|
||||
<insert tableName="feature">
|
||||
<column name="key" value="debra"/>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="debraFeature" value="(SELECT id FROM feature WHERE key = 'debra')"/>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="endless_stream-table">
|
||||
<createTable tableName="endless_stream">
|
||||
<column name="id" autoIncrement="true" type="BIGINT">
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="endless_stream.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="1.3.6/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.4.21/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.4.29/collection.xml" relativeToChangelogFile="true"/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="meetupFeature" value="(SELECT id FROM feature WHERE key = 'meetup')"/>
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="feature.xml" relativeToChangelogFile="true"/>
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
<include file="reminder_job.xml" relativeToChangelogFile="true"/>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup_feature-insertion">
|
||||
<insert tableName="feature">
|
||||
<column name="key" value="meetup"/>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup-cleanup-job-insert">
|
||||
<insert tableName="scheduler_job">
|
||||
<column name="name" value="meetupCleanupJob"/>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup-reminder-job-insert">
|
||||
<insert tableName="scheduler_job">
|
||||
<column name="name" value="meetupReminderJob"/>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup-table">
|
||||
<createTable tableName="meetup">
|
||||
<column name="id" type="BIGINT">
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup_participator-table">
|
||||
<createTable tableName="meetup_participator">
|
||||
<column name="meetup_participator_user_in_server_id" type="BIGINT">
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="meetup.xml" relativeToChangelogFile="true"/>
|
||||
<include file="meetup_participator.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="meetupFeature" value="(SELECT id FROM feature WHERE key = 'meetup')"/>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup_component-table">
|
||||
<createTable tableName="meetup_component">
|
||||
<column name="component_id" type="VARCHAR(100)">
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup_participator-table">
|
||||
<sql>
|
||||
ALTER TABLE meetup_participator DROP CONSTRAINT check_meetup_participator_decision;
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="meetup_participator.xml" relativeToChangelogFile="true"/>
|
||||
<include file="meetup_component.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="meetupFeature" value="(SELECT id FROM feature WHERE key = 'meetup')"/>
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="meetup-add_info_columns">
|
||||
<addColumn tableName="meetup">
|
||||
<column name="location" type="VARCHAR(100)" />
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="meetup.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="1.1.0/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.2.0/collection.xml" relativeToChangelogFile="true"/>
|
||||
<include file="1.3.18/collection.xml" relativeToChangelogFile="true"/>
|
||||
|
||||
43
application/sissi-modules/miepscord/pom.xml
Normal file
43
application/sissi-modules/miepscord/pom.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>dev.sheldan.sissi.application.module</groupId>
|
||||
<artifactId>miepscord</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/liquibase.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.scheduling</groupId>
|
||||
<artifactId>scheduling-int</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
|
||||
<id>liquibase</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources/migrations</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.sissi.module.miepscord;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MiepscordFeatureDefinition implements FeatureDefinition {
|
||||
WEEKLY_TEXT("weeklyText");
|
||||
|
||||
private String key;
|
||||
|
||||
MiepscordFeatureDefinition(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package dev.sheldan.sissi.module.miepscord;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:miepscord.properties")
|
||||
public class MiepscordProperties {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package dev.sheldan.sissi.module.miepscord;
|
||||
|
||||
public class MiepscordSlashCommandNames {
|
||||
public static final String MIEPSCORD_ROOT_NAME = "miepscord";
|
||||
public static final String MIEPSCORD_ROOT_NAME_CONFIG = "miepscordManage";
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.UtilityModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.interaction.InteractionService;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.TextItemServiceBean;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
@Component
|
||||
public class AddTextItem extends AbstractConditionableCommand {
|
||||
|
||||
private static final String ADD_WEEKLY_TEXT_TEXT_PARAMETER = "text";
|
||||
private static final String ADD_WEEKLY_TEXT_COMMAND_NAME = "addWeeklyText";
|
||||
private static final String ADD_WEEKLY_TEXT_RESPONSE = "addWeeklyText_response";
|
||||
|
||||
@Autowired
|
||||
private SlashCommandParameterService slashCommandParameterService;
|
||||
|
||||
@Autowired
|
||||
private TextItemServiceBean textItemServiceBean;
|
||||
|
||||
@Autowired
|
||||
private InteractionService interactionService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
String weeklyText = slashCommandParameterService.getCommandOption(ADD_WEEKLY_TEXT_TEXT_PARAMETER, event, String.class);
|
||||
textItemServiceBean.createTextItem(weeklyText, event.getMember());
|
||||
return interactionService.replyEmbed(ADD_WEEKLY_TEXT_RESPONSE, event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter textitemTextParameter = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(ADD_WEEKLY_TEXT_TEXT_PARAMETER)
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(textitemTextParameter);
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
SlashCommandConfig slashCommandConfig = SlashCommandConfig
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(MiepscordSlashCommandNames.MIEPSCORD_ROOT_NAME_CONFIG)
|
||||
.groupName("weeklytexts")
|
||||
.commandName("add")
|
||||
.build();
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(ADD_WEEKLY_TEXT_COMMAND_NAME)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.slashCommandOnly(true)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.async(true)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return MiepscordFeatureDefinition.WEEKLY_TEXT;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.UtilityModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.interaction.InteractionService;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.TextItemServiceBean;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
@Component
|
||||
public class RemoveTextItem extends AbstractConditionableCommand {
|
||||
|
||||
private static final String REMOVE_WEEKLY_TEXT_ID_PARAMETER = "id";
|
||||
private static final String REMOVE_WEEKLY_TEXT_COMMAND_NAME = "removeWeeklyText";
|
||||
|
||||
private static final String REMOVE_WEEKLY_TEXT_RESPONSE = "removeWeeklyText_response";
|
||||
|
||||
@Autowired
|
||||
private SlashCommandParameterService slashCommandParameterService;
|
||||
|
||||
@Autowired
|
||||
private TextItemServiceBean textItemServiceBean;
|
||||
|
||||
@Autowired
|
||||
private InteractionService interactionService;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
Long itemId = slashCommandParameterService.getCommandOption(REMOVE_WEEKLY_TEXT_ID_PARAMETER, event, Integer.class).longValue();
|
||||
textItemServiceBean.removeTextItem(itemId);
|
||||
return interactionService.replyEmbed(REMOVE_WEEKLY_TEXT_RESPONSE, event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter textItemId = Parameter
|
||||
.builder()
|
||||
.templated(true)
|
||||
.name(REMOVE_WEEKLY_TEXT_ID_PARAMETER)
|
||||
.type(Long.class)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(textItemId);
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
SlashCommandConfig slashCommandConfig = SlashCommandConfig
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(MiepscordSlashCommandNames.MIEPSCORD_ROOT_NAME_CONFIG)
|
||||
.groupName("weeklytexts")
|
||||
.commandName("remove")
|
||||
.build();
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(REMOVE_WEEKLY_TEXT_COMMAND_NAME)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.slashCommandOnly(true)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.async(true)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return MiepscordFeatureDefinition.WEEKLY_TEXT;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.UtilityModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.interaction.InteractionService;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
|
||||
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
|
||||
import dev.sheldan.abstracto.core.service.PaginatorService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordSlashCommandNames;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.database.TextItem;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.template.ShowTextItemModel;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.template.ShowTextItemsModel;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.management.TextItemServiceManagementBean;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
@Component
|
||||
public class ShowTextItems extends AbstractConditionableCommand {
|
||||
|
||||
private static final String SHOW_WEEKLY_TEXTS_COMMAND_NAME = "showWeeklyTexts";
|
||||
private static final String SHOW_WEEKLY_TEXTS_RESPONSE_TEMPLATE = "showWeeklyTexts";
|
||||
public static final String NO_ITEMS_TEMPLATE_KEY = "showWeeklyTexts_no_items_found";
|
||||
|
||||
private static final String SHOW_WEEKLY_TEXT_SHOW_ALL_PARAMETER = "showAll";
|
||||
|
||||
@Autowired
|
||||
private TextItemServiceManagementBean textItemServiceManagementBean;
|
||||
|
||||
@Autowired
|
||||
private PaginatorService paginatorService;
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@Autowired
|
||||
private InteractionService interactionService;
|
||||
|
||||
@Autowired
|
||||
private SlashCommandParameterService slashCommandParameterService;
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
|
||||
boolean showAll = false;
|
||||
if(slashCommandParameterService.hasCommandOption(SHOW_WEEKLY_TEXT_SHOW_ALL_PARAMETER, event)) {
|
||||
showAll = slashCommandParameterService.getCommandOption(SHOW_WEEKLY_TEXT_SHOW_ALL_PARAMETER, event, Boolean.class);
|
||||
}
|
||||
List<TextItem> textItems;
|
||||
if(showAll) {
|
||||
textItems = textItemServiceManagementBean.getAllTextItems();
|
||||
} else {
|
||||
textItems = textItemServiceManagementBean.getAllTextItemsWithDoneFlag(false);
|
||||
}
|
||||
textItems.sort(Comparator.comparing(TextItem::getCreated));
|
||||
if(textItems.isEmpty()) {
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(NO_ITEMS_TEMPLATE_KEY, new Object(), event.getGuild().getIdLong());
|
||||
return interactionService.replyMessageToSend(messageToSend, event)
|
||||
.thenApply(interactionHook -> CommandResult.fromSuccess());
|
||||
|
||||
}
|
||||
List<ShowTextItemModel> convertedTextItems = textItems.stream().map(this::convertTextItem).toList();
|
||||
ShowTextItemsModel items = ShowTextItemsModel
|
||||
.builder()
|
||||
.items(convertedTextItems)
|
||||
.build();
|
||||
return paginatorService.createPaginatorFromTemplate(SHOW_WEEKLY_TEXTS_RESPONSE_TEMPLATE, items, event)
|
||||
.thenApply(unused -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
private ShowTextItemModel convertTextItem(TextItem textItem) {
|
||||
return ShowTextItemModel
|
||||
.builder()
|
||||
.text(textItem.getText())
|
||||
.id(textItem.getId())
|
||||
.done(textItem.getDone())
|
||||
.created(textItem.getCreated())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
Parameter showAllItems = Parameter
|
||||
.builder()
|
||||
.name(SHOW_WEEKLY_TEXT_SHOW_ALL_PARAMETER)
|
||||
.type(Boolean.class)
|
||||
.optional(true)
|
||||
.templated(true)
|
||||
.build();
|
||||
|
||||
List<Parameter> parameters = Arrays.asList(showAllItems);
|
||||
|
||||
SlashCommandConfig slashCommandConfig = SlashCommandConfig
|
||||
.builder()
|
||||
.enabled(true)
|
||||
.rootCommandName(MiepscordSlashCommandNames.MIEPSCORD_ROOT_NAME)
|
||||
.groupName("weeklytexts")
|
||||
.commandName("show")
|
||||
.build();
|
||||
|
||||
return CommandConfiguration.builder()
|
||||
.name(SHOW_WEEKLY_TEXTS_COMMAND_NAME)
|
||||
.module(UtilityModuleDefinition.UTILITY)
|
||||
.templated(true)
|
||||
.slashCommandOnly(true)
|
||||
.slashCommandConfig(slashCommandConfig)
|
||||
.async(true)
|
||||
.parameters(parameters)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return MiepscordFeatureDefinition.WEEKLY_TEXT;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.config.PostTargetEnum;
|
||||
import dev.sheldan.sissi.module.miepscord.MiepscordFeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class WeeklyTextFeatureConfig implements FeatureConfig {
|
||||
|
||||
public static final String WEEKLY_TEXT_SERVER_ID = "WEEKLY_TEXT_SERVER_ID";
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return MiepscordFeatureDefinition.WEEKLY_TEXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PostTargetEnum> getRequiredPostTargets() {
|
||||
return Arrays.asList(WeeklyTextPostTarget.TEXT_ITEM_TARGET);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.PostTargetEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum WeeklyTextPostTarget implements PostTargetEnum {
|
||||
TEXT_ITEM_TARGET("textItemTarget");
|
||||
|
||||
private String key;
|
||||
|
||||
WeeklyTextPostTarget(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.job;
|
||||
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.TextItemServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.PersistJobDataAfterExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@DisallowConcurrentExecution
|
||||
@Component
|
||||
@PersistJobDataAfterExecution
|
||||
public class WeeklyTextJob extends QuartzJobBean {
|
||||
|
||||
@Autowired
|
||||
private TextItemServiceBean textItemServiceBean;
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
||||
try {
|
||||
log.info("Executing text item job.");
|
||||
textItemServiceBean.sendTexItem();
|
||||
} catch (Exception e) {
|
||||
log.error("Text item job failed.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.model.database;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Builder
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "text_item")
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class TextItem {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "text")
|
||||
private String text;
|
||||
|
||||
@Column(name = "done")
|
||||
private Boolean done;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "creator_id", nullable = false)
|
||||
private AUserInAServer creator;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@Column(name = "updated")
|
||||
private Instant updated;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.model.template;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class ShowTextItemModel {
|
||||
private String text;
|
||||
private Boolean done;
|
||||
private Instant created;
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.model.template;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class ShowTextItemsModel {
|
||||
private List<ShowTextItemModel> items;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.model.template;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class TextItemPostModel {
|
||||
private String text;
|
||||
private Long id;
|
||||
private Instant created;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.repository;
|
||||
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.database.TextItem;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface TextItemRepository extends JpaRepository<TextItem, Long> {
|
||||
List<TextItem> findByDoneFalseOrderByCreated();
|
||||
List<TextItem> findByDone(Boolean done);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.abstracto.core.service.PostTargetService;
|
||||
import dev.sheldan.abstracto.core.service.management.UserInServerManagementService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.CompletableFutureList;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.config.WeeklyTextPostTarget;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.database.TextItem;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.template.TextItemPostModel;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.management.TextItemServiceManagementBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static dev.sheldan.sissi.module.miepscord.weeklytext.config.WeeklyTextFeatureConfig.WEEKLY_TEXT_SERVER_ID;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class TextItemServiceBean {
|
||||
|
||||
public static final String WEEKLY_TEXT_ITEM_POST_TEMPLATE = "weekly_text_item_post";
|
||||
@Autowired
|
||||
private TextItemServiceManagementBean textItemServiceManagementBean;
|
||||
|
||||
@Autowired
|
||||
private UserInServerManagementService userInServerManagementService;
|
||||
|
||||
@Autowired
|
||||
private PostTargetService postTargetService;
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@Autowired
|
||||
private TextItemServiceBean self;
|
||||
|
||||
public TextItem createTextItem(String text, Member creator) {
|
||||
log.info("Creating new text item in server {} from user {}.", creator.getGuild().getIdLong(), creator.getIdLong());
|
||||
AUserInAServer creatorUser = userInServerManagementService.loadOrCreateUser(creator);
|
||||
return textItemServiceManagementBean.createTextItem(text, creatorUser);
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> sendTexItem() {
|
||||
Long serverId = Long.parseLong(System.getenv(WEEKLY_TEXT_SERVER_ID));
|
||||
Optional<TextItem> nextTextItemOptional = textItemServiceManagementBean.getNextTextItem();
|
||||
if(nextTextItemOptional.isEmpty()) {
|
||||
log.info("No next text item found.");
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
TextItem textItem = nextTextItemOptional.get();
|
||||
log.info("Sending text item {}.", textItem.getId());
|
||||
Long textItemId = textItem.getId();
|
||||
TextItemPostModel model = TextItemPostModel
|
||||
.builder()
|
||||
.id(textItemId)
|
||||
.created(textItem.getCreated())
|
||||
.text(textItem.getText())
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(WEEKLY_TEXT_ITEM_POST_TEMPLATE, model, serverId);
|
||||
List<CompletableFuture<Message>> futures = postTargetService.sendEmbedInPostTarget(messageToSend, WeeklyTextPostTarget.TEXT_ITEM_TARGET, serverId);
|
||||
CompletableFutureList<Message> futureList = new CompletableFutureList<>(futures);
|
||||
return futureList.getMainFuture().thenAccept(unused -> {
|
||||
self.setTexItemToDone(textItemId);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void setTexItemToDone(Long id) {
|
||||
Optional<TextItem> textItemOptional = textItemServiceManagementBean.findTextItemById(id);
|
||||
textItemOptional.ifPresentOrElse(textItem -> {
|
||||
log.info("Setting textItem with ID {} to done.", id);
|
||||
textItem.setDone(true);
|
||||
}, () -> log.info("TextItem {} not found.", id));
|
||||
}
|
||||
|
||||
public void removeTextItem(Long id) {
|
||||
log.info("Deleting text item with ID {}.", id);
|
||||
textItemServiceManagementBean.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package dev.sheldan.sissi.module.miepscord.weeklytext.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.database.TextItem;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.repository.TextItemRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Component
|
||||
public class TextItemServiceManagementBean {
|
||||
|
||||
@Autowired
|
||||
private TextItemRepository textItemRepository;
|
||||
|
||||
@Autowired
|
||||
private SecureRandom secureRandom;
|
||||
|
||||
public TextItem createTextItem(String text, AUserInAServer aUserInAServer) {
|
||||
TextItem textItem = TextItem
|
||||
.builder()
|
||||
.text(text)
|
||||
.creator(aUserInAServer)
|
||||
.done(false)
|
||||
.build();
|
||||
return textItemRepository.save(textItem);
|
||||
}
|
||||
|
||||
public Optional<TextItem> getNextTextItem() {
|
||||
List<TextItem> allItems = textItemRepository.findByDoneFalseOrderByCreated();
|
||||
if(allItems.isEmpty()) {
|
||||
return Optional.empty();
|
||||
} else {
|
||||
return Optional.of(allItems.get(secureRandom.nextInt(allItems.size())));
|
||||
}
|
||||
}
|
||||
|
||||
public Optional<TextItem> findTextItemById(Long id) {
|
||||
return textItemRepository.findById(id);
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
textItemRepository.deleteById(id);
|
||||
}
|
||||
|
||||
public List<TextItem> getAllTextItems() {
|
||||
return textItemRepository.findAll();
|
||||
}
|
||||
|
||||
public List<TextItem> getAllTextItemsWithDoneFlag(boolean done) {
|
||||
return textItemRepository.findByDone(done);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
abstracto.featureFlags.weeklyText.featureName=weeklyText
|
||||
abstracto.featureFlags.weeklyText.enabled=false
|
||||
|
||||
abstracto.postTargets.textItemTarget.name=textItemTarget
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<property name="utilityModule" value="(SELECT id FROM module WHERE name = 'utility')"/>
|
||||
<property name="weeklyTextFeature" value="(SELECT id FROM feature WHERE key = 'weeklyText')"/>
|
||||
<changeSet author="Sheldan" id="weeklyText-commands" >
|
||||
<insert tableName="command">
|
||||
<column name="name" value="addWeeklyText"/>
|
||||
<column name="module_id" valueComputed="${utilityModule}"/>
|
||||
<column name="feature_id" valueComputed="${weeklyTextFeature}"/>
|
||||
</insert>
|
||||
<insert tableName="command">
|
||||
<column name="name" value="removeWeeklyText"/>
|
||||
<column name="module_id" valueComputed="${utilityModule}"/>
|
||||
<column name="feature_id" valueComputed="${weeklyTextFeature}"/>
|
||||
</insert>
|
||||
<insert tableName="command">
|
||||
<column name="name" value="showWeeklyTexts"/>
|
||||
<column name="module_id" valueComputed="${utilityModule}"/>
|
||||
<column name="feature_id" valueComputed="${weeklyTextFeature}"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="feature.xml" relativeToChangelogFile="true"/>
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
<include file="weekly_text_job.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="weeklyText_feature-insertion">
|
||||
<insert tableName="feature">
|
||||
<column name="key" value="weeklyText"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<changeSet author="Sheldan" id="weekly_text_job-insert">
|
||||
<insert tableName="scheduler_job">
|
||||
<column name="name" value="weeklyTextJob"/>
|
||||
<column name="group_name" value="miepscord"/>
|
||||
<column name="clazz" value="dev.sheldan.sissi.module.miepscord.weeklytext.job.WeeklyTextJob"/>
|
||||
<column name="active" value="true"/>
|
||||
<column name="cron_expression" value="0 0 14 ? * FRI *"/>
|
||||
<column name="recovery" value="false"/>
|
||||
</insert>
|
||||
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="text_item.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
|
||||
<changeSet author="Sheldan" id="text_item-table">
|
||||
<createTable tableName="text_item">
|
||||
<column name="id" autoIncrement="true" type="BIGINT">
|
||||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_text_item"/>
|
||||
</column>
|
||||
<column name="text" type="VARCHAR">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="done" type="BOOLEAN">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="creator_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||
</createTable>
|
||||
<addForeignKeyConstraint baseColumnNames="creator_id" baseTableName="text_item" constraintName="fk_text_item_creator"
|
||||
deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION"
|
||||
referencedColumnNames="user_in_server_id" referencedTableName="user_in_server" validate="true"/>
|
||||
<sql>
|
||||
DROP TRIGGER IF EXISTS text_item_update_trigger ON text_item;
|
||||
CREATE TRIGGER repost_check_channel_group_update_trigger BEFORE UPDATE ON text_item FOR EACH ROW EXECUTE PROCEDURE update_trigger_procedure();
|
||||
</sql>
|
||||
<sql>
|
||||
DROP TRIGGER IF EXISTS text_item_insert_trigger ON text_item;
|
||||
CREATE TRIGGER repost_check_channel_group_insert_trigger BEFORE INSERT ON text_item FOR EACH ROW EXECUTE PROCEDURE insert_trigger_procedure();
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||
<include file="1.4.61/collection.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,13 +3,21 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.4.37</version>
|
||||
<version>1.4.62</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>dev.sheldan.sissi.application.module</groupId>
|
||||
<artifactId>quotes</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>starboard-int</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -5,7 +5,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum QuotesFeatureDefinition implements FeatureDefinition {
|
||||
QUOTES("quotes");
|
||||
QUOTES("quotes"), STARBOARD_QUOTE_SYNC("starboardQuoteSync");
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.sheldan.sissi.module.quotes.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class StarboardQuoteSyncFeatureConfig implements FeatureConfig {
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return QuotesFeatureDefinition.STARBOARD_QUOTE_SYNC;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package dev.sheldan.sissi.module.quotes.listener;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.listener.DefaultListenerResult;
|
||||
import dev.sheldan.abstracto.core.service.MessageService;
|
||||
import dev.sheldan.abstracto.starboard.listener.StarboardPostCreatedListener;
|
||||
import dev.sheldan.abstracto.starboard.model.StarboardPostCreatedModel;
|
||||
import dev.sheldan.sissi.module.quotes.config.QuotesFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.quotes.service.QuoteServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StarboardPostCreatedListenerBean implements StarboardPostCreatedListener {
|
||||
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
|
||||
@Autowired
|
||||
private QuoteServiceBean quoteServiceBean;
|
||||
|
||||
@Autowired
|
||||
private StarboardPostCreatedListenerBean self;
|
||||
|
||||
@Override
|
||||
public DefaultListenerResult execute(StarboardPostCreatedModel model) {
|
||||
Long serverId = model.getServerId();
|
||||
Long starboardPostId = model.getStarboardPostId();
|
||||
messageService.loadMessage(serverId, model.getStarredMessage().getChannelId(), model.getStarredMessage().getMessageId())
|
||||
.thenAccept(message -> self.storeQuote(message, model))
|
||||
.exceptionally(throwable -> {
|
||||
log.error("Failed to persist quote for starboard post {} in server {}.", starboardPostId, serverId, throwable);
|
||||
return null;
|
||||
});
|
||||
return DefaultListenerResult.PROCESSED;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void storeQuote(Message message, StarboardPostCreatedModel model) {
|
||||
log.info("Creating quote from starboard post {} in server {} from user {} because of user {}.", model.getStarboardPostId(), model.getServerId(),
|
||||
model.getStarredUser().getUserId(), model.getLastStarrer().getUserId());
|
||||
quoteServiceBean.createQuote(model.getStarredUser(), model.getLastStarrer(), message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return QuotesFeatureDefinition.STARBOARD_QUOTE_SYNC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package dev.sheldan.sissi.module.quotes.listener;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.listener.DefaultListenerResult;
|
||||
import dev.sheldan.abstracto.starboard.listener.StarboardPostDeletedListener;
|
||||
import dev.sheldan.abstracto.starboard.model.StarboardPostDeletedModel;
|
||||
import dev.sheldan.sissi.module.quotes.config.QuotesFeatureDefinition;
|
||||
import dev.sheldan.sissi.module.quotes.service.QuoteServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StarboardPostDeletedListenerBean implements StarboardPostDeletedListener {
|
||||
|
||||
@Autowired
|
||||
private QuoteServiceBean quoteServiceBean;
|
||||
|
||||
@Override
|
||||
public DefaultListenerResult execute(StarboardPostDeletedModel model) {
|
||||
log.info("Handling delete of starboard post {}, causing the quote of message {} in server {} to be deleted.", model.getStarboardPostId(), model.getStarredMessage().getMessageId(), model.getServerId());
|
||||
quoteServiceBean.deleteByMessageId(model.getStarredMessage().getMessageId());
|
||||
return DefaultListenerResult.PROCESSED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return QuotesFeatureDefinition.STARBOARD_QUOTE_SYNC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,12 +21,12 @@ import java.util.List;
|
||||
@EqualsAndHashCode
|
||||
public class Quote {
|
||||
|
||||
@EmbeddedId
|
||||
@Getter
|
||||
private ServerSpecificId id;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY)
|
||||
@MapsId("serverId")
|
||||
@JoinColumn(name = "server_id", nullable = false)
|
||||
private AServer server;
|
||||
|
||||
@@ -58,9 +58,9 @@ public class Quote {
|
||||
@Column(name = "text")
|
||||
private String text;
|
||||
|
||||
@Column(name = "created")
|
||||
@Column(name = "created", insertable = false, updatable = false)
|
||||
private Instant created;
|
||||
|
||||
@Column(name = "updated")
|
||||
@Column(name = "updated", insertable = false, updatable = false)
|
||||
private Instant updated;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.sheldan.sissi.module.quotes.model.database;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import lombok.*;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
@@ -16,7 +17,7 @@ public class QuoteAttachment {
|
||||
|
||||
@Id
|
||||
@Getter
|
||||
@Setter
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@@ -25,8 +26,7 @@ public class QuoteAttachment {
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumns(
|
||||
{
|
||||
@JoinColumn(updatable = false, insertable = false, name = "quote_id", referencedColumnName = "id"),
|
||||
@JoinColumn(updatable = false, insertable = false, name = "server_id", referencedColumnName = "server_id")
|
||||
@JoinColumn(updatable = false, name = "quote_id", referencedColumnName = "id")
|
||||
})
|
||||
private Quote quote;
|
||||
|
||||
@@ -35,6 +35,10 @@ public class QuoteAttachment {
|
||||
@Column(name = "url", nullable = false)
|
||||
private String url;
|
||||
|
||||
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "server_id", nullable = false)
|
||||
private AServer server;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Column(name = "is_image", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package dev.sheldan.sissi.module.quotes.repository;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.ServerSpecificId;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.sissi.module.quotes.model.database.Quote;
|
||||
@@ -8,13 +7,16 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface QuoteRepository extends JpaRepository<Quote, ServerSpecificId> {
|
||||
public interface QuoteRepository extends JpaRepository<Quote, Long> {
|
||||
List<Quote> findByTextContainingAndServer(String text, AServer server);
|
||||
List<Quote> findByTextContainingAndServerAndAuthor(String text, AServer server, AUserInAServer author);
|
||||
List<Quote> findByServer(AServer server);
|
||||
List<Quote> findByAuthor(AUserInAServer author);
|
||||
Long countByAuthor(AUserInAServer author);
|
||||
Long countByAdder(AUserInAServer adder);
|
||||
|
||||
Optional<Quote> findByMessageId(Long messageId);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sheldan.sissi.module.quotes.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
||||
import dev.sheldan.abstracto.core.models.ServerSpecificId;
|
||||
import dev.sheldan.abstracto.core.models.ServerUser;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.abstracto.core.service.ChannelService;
|
||||
@@ -16,11 +16,12 @@ import dev.sheldan.sissi.module.quotes.model.command.QuoteResponseModel;
|
||||
import dev.sheldan.sissi.module.quotes.model.command.QuoteStatsModel;
|
||||
import dev.sheldan.sissi.module.quotes.model.database.Quote;
|
||||
import dev.sheldan.sissi.module.quotes.model.database.QuoteAttachment;
|
||||
import dev.sheldan.sissi.module.quotes.repository.QuoteRepository;
|
||||
import dev.sheldan.sissi.module.quotes.service.management.QuoteManagementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
import net.dv8tion.jda.api.entities.channel.Channel;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -35,9 +36,6 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class QuoteServiceBean {
|
||||
|
||||
@Autowired
|
||||
private QuoteRepository quoteRepository;
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@@ -56,11 +54,14 @@ public class QuoteServiceBean {
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
|
||||
@Autowired
|
||||
private QuoteManagementService quoteManagementService;
|
||||
|
||||
private static final String QUOTE_RESPONSE_TEMPLATE_KEY = "quote_response";
|
||||
|
||||
public Optional<Quote> getRandomQuoteForMember(AUserInAServer aUserInAServer) {
|
||||
// not nice, but good enough for now
|
||||
List<Quote> allQuotes = quoteRepository.findByAuthor(aUserInAServer);
|
||||
List<Quote> allQuotes = quoteManagementService.getFromAuthor(aUserInAServer);
|
||||
if(allQuotes.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
@@ -69,7 +70,7 @@ public class QuoteServiceBean {
|
||||
|
||||
public Optional<Quote> getRandomQuote(AServer server) {
|
||||
// not nice, but good enough for now
|
||||
List<Quote> allQuotes = quoteRepository.findByServer(server);
|
||||
List<Quote> allQuotes = quoteManagementService.getFromServer(server);
|
||||
if(allQuotes.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
@@ -79,7 +80,7 @@ public class QuoteServiceBean {
|
||||
public void deleteQuote(Long quoteId, AServer server) {
|
||||
Optional<Quote> existingQuote = getQuote(quoteId, server);
|
||||
if(existingQuote.isPresent()) {
|
||||
quoteRepository.delete(existingQuote.get());
|
||||
quoteManagementService.deleteQuote(existingQuote.get());
|
||||
log.info("Deleting quote with id {} in server {}.", quoteId, server.getId());
|
||||
} else {
|
||||
throw new QuoteNotFoundException();
|
||||
@@ -87,9 +88,8 @@ public class QuoteServiceBean {
|
||||
}
|
||||
|
||||
public Optional<Quote> getQuote(Long quoteId, AServer server) {
|
||||
ServerSpecificId id = new ServerSpecificId(server.getId(), quoteId);
|
||||
log.info("Loading quote with id {} in server {}.", quoteId, server.getId());
|
||||
return quoteRepository.findById(id);
|
||||
return quoteManagementService.getQuote(quoteId);
|
||||
}
|
||||
|
||||
public CompletableFuture<MessageToSend> renderQuoteToMessageToSend(Quote quote) {
|
||||
@@ -118,7 +118,7 @@ public class QuoteServiceBean {
|
||||
.builder()
|
||||
.quoteContent(quote.getText())
|
||||
.imageAttachmentURLs(imageAttachments)
|
||||
.quoteId(quote.getId().getId())
|
||||
.quoteId(quote.getId())
|
||||
.fileAttachmentURLs(fileAttachments)
|
||||
.creationDate(quote.getCreated())
|
||||
.quotedMessage(quotedMessage);
|
||||
@@ -209,7 +209,7 @@ public class QuoteServiceBean {
|
||||
}
|
||||
|
||||
public Optional<Quote> searchQuote(String query, AServer server) {
|
||||
List<Quote> foundQuotes = quoteRepository.findByTextContainingAndServer(query, server);
|
||||
List<Quote> foundQuotes = quoteManagementService.getQuotesWithTextInServer(query, server);
|
||||
if(foundQuotes.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
@@ -224,7 +224,7 @@ public class QuoteServiceBean {
|
||||
|
||||
public Optional<Quote> searchQuote(String query, AServer server, Member targetMember) {
|
||||
AUserInAServer author = userInServerManagementService.loadOrCreateUser(targetMember);
|
||||
List<Quote> foundQuotes = quoteRepository.findByTextContainingAndServerAndAuthor(query, server, author);
|
||||
List<Quote> foundQuotes = quoteManagementService.getQuotesWithTextInServerFromAuthor(query, server, author);
|
||||
if(foundQuotes.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
@@ -242,8 +242,8 @@ public class QuoteServiceBean {
|
||||
return getQuoteStats(user, member);
|
||||
}
|
||||
public QuoteStatsModel getQuoteStats(AUserInAServer user, Member member) {
|
||||
Long authored = quoteRepository.countByAuthor(user);
|
||||
Long added = quoteRepository.countByAdder(user);
|
||||
Long authored = quoteManagementService.getAmountOfQuotesOfAuthor(user);
|
||||
Long added = quoteManagementService.getAmountOfQuotesOfAdder(user);
|
||||
return QuoteStatsModel
|
||||
.builder()
|
||||
.quoteCount(added)
|
||||
@@ -253,4 +253,21 @@ public class QuoteServiceBean {
|
||||
.serverId(user.getServerReference().getId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public Quote createQuote(ServerUser authorUser, ServerUser adderUser, Message quoteMessage) {
|
||||
AUserInAServer author = userInServerManagementService.loadOrCreateUser(authorUser);
|
||||
AUserInAServer adder = userInServerManagementService.loadOrCreateUser(adderUser);
|
||||
List<Pair<String, Boolean>> attachments = quoteMessage
|
||||
.getAttachments()
|
||||
.stream()
|
||||
.map(attachment -> Pair.of(attachment.getProxyUrl(), attachment.isImage()))
|
||||
.toList();
|
||||
return quoteManagementService.createQuote(author, adder, quoteMessage.getContentDisplay(), ServerChannelMessage.fromMessage(quoteMessage), attachments);
|
||||
}
|
||||
|
||||
public void deleteByMessageId(Long messageId) {
|
||||
Quote quote = quoteManagementService.findByMessage(messageId).orElseThrow(QuoteNotFoundException::new);
|
||||
log.info("Deleting quote {} in server {}.", quote.getId(), quote.getServer().getId());
|
||||
quoteManagementService.deleteQuote(quote);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.sheldan.sissi.module.quotes.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
||||
import dev.sheldan.abstracto.core.models.database.AChannel;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||
import dev.sheldan.abstracto.core.service.management.ChannelManagementService;
|
||||
import dev.sheldan.sissi.module.quotes.model.database.Quote;
|
||||
import dev.sheldan.sissi.module.quotes.model.database.QuoteAttachment;
|
||||
import dev.sheldan.sissi.module.quotes.repository.QuoteRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class QuoteManagementService {
|
||||
|
||||
@Autowired
|
||||
private QuoteRepository quoteRepository;
|
||||
|
||||
@Autowired
|
||||
private ChannelManagementService channelManagementService;
|
||||
|
||||
public Quote createQuote(AUserInAServer author, AUserInAServer adder, String messageText, ServerChannelMessage quotedMessage, List<Pair<String, Boolean>> attachments) {
|
||||
AChannel channel = channelManagementService.loadChannel(quotedMessage.getChannelId());
|
||||
|
||||
Quote quote = Quote
|
||||
.builder()
|
||||
.adder(adder)
|
||||
.author(author)
|
||||
.text(messageText)
|
||||
.messageId(quotedMessage.getMessageId())
|
||||
.server(adder.getServerReference())
|
||||
.sourceChannel(channel)
|
||||
.build();
|
||||
List<QuoteAttachment> quoteAttachments = attachments
|
||||
.stream()
|
||||
.map(stringBooleanPair -> QuoteAttachment
|
||||
.builder()
|
||||
.url(stringBooleanPair.getLeft())
|
||||
.quote(quote)
|
||||
.server(adder.getServerReference())
|
||||
.isImage(stringBooleanPair.getRight())
|
||||
.build())
|
||||
.toList();
|
||||
|
||||
log.info("Creating quote from {} added by {} in server {}.", author.getUserReference().getId(), adder.getUserReference().getId(), author.getServerReference().getId());
|
||||
|
||||
quote.setAttachments(quoteAttachments);
|
||||
|
||||
return quoteRepository.save(quote);
|
||||
}
|
||||
|
||||
public List<Quote> getFromAuthor(AUserInAServer author) {
|
||||
return quoteRepository.findByAuthor(author);
|
||||
}
|
||||
|
||||
public List<Quote> getFromServer(AServer aServer) {
|
||||
return quoteRepository.findByServer(aServer);
|
||||
}
|
||||
|
||||
public void deleteQuote(Quote quote) {
|
||||
quoteRepository.delete(quote);
|
||||
}
|
||||
|
||||
public Optional<Quote> getQuote(Long quoteId) {
|
||||
return quoteRepository.findById(quoteId);
|
||||
}
|
||||
|
||||
public List<Quote> getQuotesWithTextInServer(String text, AServer server) {
|
||||
return quoteRepository.findByTextContainingAndServer(text, server);
|
||||
}
|
||||
|
||||
public List<Quote> getQuotesWithTextInServerFromAuthor(String text, AServer server, AUserInAServer aUserInAServer) {
|
||||
return quoteRepository.findByTextContainingAndServerAndAuthor(text, server, aUserInAServer);
|
||||
}
|
||||
|
||||
public Long getAmountOfQuotesOfAuthor(AUserInAServer aUserInAServer) {
|
||||
return quoteRepository.countByAuthor(aUserInAServer);
|
||||
}
|
||||
|
||||
public Long getAmountOfQuotesOfAdder(AUserInAServer aUserInAServer) {
|
||||
return quoteRepository.countByAdder(aUserInAServer);
|
||||
}
|
||||
|
||||
public Optional<Quote> findByMessage(Long messageId) {
|
||||
return quoteRepository.findByMessageId(messageId);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user