Class ApprovedPostService
java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.ApprovedPostService
Service for managing approved posts.
Provides methods to save, poll, and delete approved posts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeletes approved posts that contain any of the specified message IDs.poll()
Polls the first approved post ordered by the approval timestamp.Saves an approved post with the given message IDs and caption removal flag.
-
Constructor Details
-
ApprovedPostService
public ApprovedPostService()
-
-
Method Details
-
save
Saves an approved post with the given message IDs and caption removal flag.- Parameters:
messageIds
- the list of message IDs to associate with the approved post.removeCaption
- flag indicating whether to remove the caption from the post.- Returns:
- the saved
ApprovedPost
entity.
-
poll
Polls the first approved post ordered by the approval timestamp. If an approved post is found, it is deleted from the repository.- Returns:
- an
Optional
containing the polled approved post, or empty if none found.
-
delete
Deletes approved posts that contain any of the specified message IDs.- Parameters:
messageIds
- a list of message IDs to search for.- Returns:
- a list of
ApprovedPost
entities that were deleted.
-