Package com.bytedesk.core.notice
Class NoticeService
java.lang.Object
com.bytedesk.core.notice.NoticeService
Service for handling notice operations
- Since:
- 2024-12-04
- Author:
- jackning 270580156@qq.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
Enum for message types -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IMessageSendService
private final org.modelmapper.ModelMapper
private final ThreadRestService
private final UidUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate MessageProtobuf
createMessageByType
(NoticeService.MessageType messageType, ThreadEntity thread, NoticeRequest request, String jsonContent) Create message based on the message typevoid
sendLoginNotice
(NoticeRequest request) Send a login notice to a uservoid
sendNotice
(NoticeRequest request) Send a general notice to a userprivate void
sendNoticeMessage
(NoticeRequest request, NoticeService.MessageType messageType) Send notice message based on the message typeprivate void
validateNoticeRequest
(NoticeRequest request) Validate the notice request
-
Field Details
-
threadRestService
-
messageSendService
-
uidUtils
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper
-
-
Constructor Details
-
NoticeService
public NoticeService()
-
-
Method Details
-
sendNotice
Send a general notice to a user- Parameters:
request
- the notice request- Throws:
IllegalArgumentException
- if request is null or invalid
-
sendLoginNotice
Send a login notice to a user- Parameters:
request
- the notice request- Throws:
IllegalArgumentException
- if request is null or invalid
-
sendNoticeMessage
Send notice message based on the message type- Parameters:
request
- the notice requestmessageType
- the type of message to create
-
createMessageByType
private MessageProtobuf createMessageByType(NoticeService.MessageType messageType, ThreadEntity thread, NoticeRequest request, String jsonContent) Create message based on the message type- Parameters:
messageType
- the type of messagethread
- the thread entityrequest
- the notice requestjsonContent
- the JSON content- Returns:
- the created message
-
validateNoticeRequest
Validate the notice request- Parameters:
request
- the notice request to validate- Throws:
IllegalArgumentException
- if the request is invalid
-