Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #135

Merged
merged 4 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ class CustomDiscordNotifier(private val discordClient: DiscordClient, private va
return Mono.empty()
}

return Mono.fromRunnable<Void> {
return Mono.fromRunnable {
val createMessageDto = CreateMessageDto(createContent(event, instance))
discordClient.sendMessage(adminDiscordProperties.channelId, createMessageDto).block()
discordClient.sendMessage(adminDiscordProperties.channelId, createMessageDto)
}

}

protected fun createContent(event: InstanceEvent, instance: Instance?): String {
return """

Instance: ${event.instance.value}
Version: ${event.version}
Timestamp: ${event.timestamp}
State: ${event.type}
""".trimIndent()
}

Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions admin-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true

Expand Down
2 changes: 0 additions & 2 deletions admin-service/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true

Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions authentication-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true
flyway:
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions chess-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true
flyway:
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions fitness-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true
flyway:
Expand Down
2 changes: 0 additions & 2 deletions gateway-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true

main:
allow-bean-definition-overriding: true
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions music-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ spring:
include-description: true
openfeign:
lazy-attributes-resolution: true
httpclient:
disable-ssl-validation: true
main:
allow-bean-definition-overriding: true
flyway:
Expand Down

This file was deleted.

26 changes: 3 additions & 23 deletions spring-boot-starter-discord/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,13 @@

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>

<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-core</artifactId>
</dependency>

<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http</artifactId>
</dependency>

<dependency>
<groupId>io.projectreactor.kotlin</groupId>
<artifactId>reactor-kotlin-extensions</artifactId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
package com.michibaum.discord.api

import com.michibaum.discord.api.dtos.*
import reactor.core.publisher.Mono

interface DiscordClient {
/**
* Sends a message to the specified Discord channel.
*
* @param channelId The unique identifier of the Discord channel where the message will be sent.
* @param messageDto The data transfer object containing the content of the message to be sent.
* @return A Mono emitting the DTO of the sent message, containing details such as its unique identifier and content.
* @param messageDto A data transfer object containing the content of the message to be sent.
* @return A `GetMessageDto` object containing details of the message that was sent, including its unique ID, content, and the channel ID where it was sent.
*/
fun sendMessage(channelId: String, messageDto: CreateMessageDto): Mono<GetMessageDto>
fun sendMessage(channelId: String, messageDto: CreateMessageDto): GetMessageDto

/**
* Retrieves information about the guild associated with the Discord client.
*
* @return A Mono emitting the DTO containing details of the guild, such as ID, name, description, features, owner ID, application ID, verification level, roles, default message
* notifications, max members, max video channel users, and preferred locale.
* @return A `GetGuildeDto` object containing details such as the guild's ID, name, description, features, owner ID,
* roles, and other attributes.
*/
fun getGuild(): Mono<GetGuildeDto>
fun getGuild(): GetGuildeDto

/**
* Retrieves a list of channels for the associated Discord guild.
* Retrieves a list of channels associated with the configured Discord guild.
*
* @return A Mono emitting a list of GetChannelDto objects, each representing details of a Discord channel.
* This method makes an HTTP request to the Discord API to fetch all channels within the guild
* using the client's guild ID. Each channel is represented as a `GetChannelDto` object containing
* details such as the channel's ID, name, type, and other attributes.
*
* @return A list of `GetChannelDto` objects representing the channels in the guild.
* The list is non-null but could be empty if the guild has no channels.
*/
fun getChannels(): Mono<List<GetChannelDto>>
fun getChannels(): List<GetChannelDto>

/**
* Creates a new Discord channel based on the provided channel details.
* Creates a new Discord channel in the configured guild.
*
* This method sends a request to the Discord API to create a channel based on the supplied parameters.
*
* @param channelDto The data transfer object containing the details required to create the new channel.
* @return A Mono emitting the DTO of the created channel, containing its unique identifier, name, type, guild ID, and other relevant details.
* @param channelDto A data transfer object containing the details required to create a new channel,
* such as its name, type, and optional parent category ID.
* @return A `GetChannelDto` object containing details of the newly created channel,
* including its ID, name, type, and associated guild ID.
*/
fun createChannel(channelDto: CreateChannelDto): Mono<GetChannelDto>
fun createChannel(channelDto: CreateChannelDto): GetChannelDto
}
Loading
Loading