Package idatt2106.group3.backend.Service
Class MessageService
- java.lang.Object
-
- idatt2106.group3.backend.Service.MessageService
-
@Service public class MessageService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MessageService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
createMessage(long chatId, Message message)
Save a new message in the database, and add it to the chat.MessageDTO
createMessageDTO(MessageDTO messageDTO)
Creates new message based on information from messageDTO and saves it in the database.
-
-
-
Method Detail
-
createMessage
public Message createMessage(long chatId, Message message)
Save a new message in the database, and add it to the chat.- Parameters:
chatId
-message
-- Returns:
- created message
-
createMessageDTO
public MessageDTO createMessageDTO(MessageDTO messageDTO)
Creates new message based on information from messageDTO and saves it in the database.- Parameters:
messageDTO
-- Returns:
- messageDTO
-
-