parent
9e65e55290
commit
038760b094
@ -1,21 +1,17 @@
|
|||||||
package jty.expressdistributionsystem.utils;
|
package jty.expressdistributionsystem.utils;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import jty.expressdistributionsystem.DTO.SendMessageDTO;
|
import jty.expressdistributionsystem.DTO.SendMessageDTO;
|
||||||
import jty.expressdistributionsystem.entity.Message;
|
import jty.expressdistributionsystem.entity.Message;
|
||||||
import jty.expressdistributionsystem.service.MessageService;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class SendMessage {
|
public class SendMessage {
|
||||||
@Resource
|
|
||||||
private static MessageService messageService;
|
|
||||||
|
|
||||||
public static void sendMessage(@NotNull SendMessageDTO sendMessageDTO) {
|
public static Message sendMessage(@NotNull SendMessageDTO sendMessageDTO) {
|
||||||
Long sendId = GetIdUtil.getId();
|
Long sendId = GetIdUtil.getId();
|
||||||
Message message = new Message();
|
Message message = new Message();
|
||||||
message.setSendUserId(sendId);
|
message.setSendUserId(sendId);
|
||||||
message.setGetUserId(sendMessageDTO.getId());
|
message.setGetUserId(sendMessageDTO.getId());
|
||||||
message.setContent(sendMessageDTO.getContent());
|
message.setContent(sendMessageDTO.getContent());
|
||||||
messageService.save(message);
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue