-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add pageable message builder interface and implementation #95
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
base: version/1.21
Are you sure you want to change the base?
feat: add pageable message builder interface and implementation #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new DSL-based interface for paginated messages along with its concrete implementation.
- Added SurfPageableMessageBuilder interface with DSL methods for title and content lines.
- Implemented PageableMessageBuilder providing functionalities for pagination and navigation.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageImpl.kt | Implements paginated message rendering including a navigation component and error handling for page bounds. |
surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageBuilder.kt | Adds DSL interface for building paginated messages with configuration for title, content lines, and page command. |
...i/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageImpl.kt
Outdated
Show resolved
Hide resolved
…rImpl and add click event handling
@twisti-dev You have to fix the GH Action to accept PRs from forks. |
Yes, I know that obviously, but I don’t have time right now. |
This pull request introduces a new DSL-based interface and its implementation for building and sending paginated messages in the
surf-api-core
module. The changes include defining theSurfPageableMessageBuilder
interface and providing a concrete implementation,PageableMessageBuilder
, which supports customization of message content, pagination, and navigation.New DSL Interface for Paginated Messages:
SurfPageableMessageBuilder
interface: Added a DSL interface to define paginated messages, allowing customization of lines per page, page navigation commands, message title, and content lines. It also includes a method to send messages to anAudience
at a specific page. ([surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageBuilder.ktR1-R60](https://github.com/SLNE-Development/surf-api/pull/95/files#diff-896975cf4975132a2d217513118a4812f77c5baa8fcdab404a5d36d2a39a8d69R1-R60)
)Implementation of Paginated Messages:
PageableMessageBuilder
class: Implemented theSurfPageableMessageBuilder
interface, providing functionality for managing message content, calculating pagination, and rendering navigation buttons. It includes methods for setting the title, adding content lines, and sending paginated messages with error handling for invalid page numbers. ([surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageImpl.ktR1-R95](https://github.com/SLNE-Development/surf-api/pull/95/files#diff-81fa4ff54e1e2ff90436e88f527d9372b1bdcc54d41fd7655960ecb225ece01fR1-R95)
)