Class NoticeService

java.lang.Object
com.bytedesk.core.notice.NoticeService

@Service public class NoticeService extends Object
Service for handling notice operations
Since:
2024-12-04
Author:
jackning 270580156@qq.com
  • Field Details

    • threadRestService

      private final ThreadRestService threadRestService
    • messageSendService

      private final IMessageSendService messageSendService
    • uidUtils

      private final UidUtils uidUtils
    • modelMapper

      private final org.modelmapper.ModelMapper modelMapper
  • Constructor Details

    • NoticeService

      public NoticeService()
  • Method Details

    • sendNotice

      public void sendNotice(NoticeRequest request)
      Send a general notice to a user
      Parameters:
      request - the notice request
      Throws:
      IllegalArgumentException - if request is null or invalid
    • sendLoginNotice

      public void sendLoginNotice(NoticeRequest request)
      Send a login notice to a user
      Parameters:
      request - the notice request
      Throws:
      IllegalArgumentException - if request is null or invalid
    • sendNoticeMessage

      private void sendNoticeMessage(NoticeRequest request, NoticeService.MessageType messageType)
      Send notice message based on the message type
      Parameters:
      request - the notice request
      messageType - 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 message
      thread - the thread entity
      request - the notice request
      jsonContent - the JSON content
      Returns:
      the created message
    • validateNoticeRequest

      private void validateNoticeRequest(NoticeRequest request)
      Validate the notice request
      Parameters:
      request - the notice request to validate
      Throws:
      IllegalArgumentException - if the request is invalid