-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add api module and add rabbitmqMessage class
Api module will be published in order to be used in other java project like AurionChat-Automessage #39
- Loading branch information
1 parent
aecbfae
commit b51ad76
Showing
7 changed files
with
142 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish | ||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: corretto | ||
java-version: 17 | ||
- name: Cleanup Gradle Cache | ||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | ||
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
- name: Setup Gradle Wrapper Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-library-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
- name: Change version | ||
run: | | ||
sed -i "s/pluginVersion=SNAPSHOT/pluginVersion=${{ inputs.version}}/" gradle.properties | ||
- name: Publish Gradle Package | ||
run: ./gradlew :api:build -x test :api:publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
plugins { | ||
id("java-library") | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
dependencies { | ||
compileOnly 'com.google.code.gson:gson:2.10.1' | ||
} | ||
|
||
publishing { | ||
publications { | ||
gpr(MavenPublication) { | ||
from(components.java) | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = "https://maven.pkg.github.com/Mineaurion/aurionchat" | ||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
api/src/main/java/com/mineaurion/aurionchat/api/RabbitMQMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.mineaurion.aurionchat.api; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class RabbitMQMessage { | ||
|
||
private String channel; | ||
|
||
public enum Type { | ||
@SerializedName("chat") | ||
CHAT, | ||
@SerializedName("automessage") | ||
AUTO_MESSAGE; | ||
}; | ||
|
||
private Type type; | ||
|
||
private String message; | ||
|
||
public RabbitMQMessage(String channel, Type type, String message){ | ||
this.channel = channel; | ||
this.type = type; | ||
this.message = message; | ||
} | ||
|
||
public String getChannel() { | ||
return channel; | ||
} | ||
|
||
public RabbitMQMessage setChannel(String channel) { | ||
this.channel = channel; | ||
return this; | ||
} | ||
|
||
public Type getType() { | ||
return type; | ||
} | ||
|
||
public RabbitMQMessage setType(Type type) { | ||
this.type = type; | ||
return this; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public RabbitMQMessage setMessage(String message) { | ||
this.message = message; | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters