Skip to content

Commit

Permalink
Merge pull request #65 from oven-2023/feature/chat
Browse files Browse the repository at this point in the history
refactor: edit message response
  • Loading branch information
haen-su authored Nov 14, 2023
2 parents 742e9e7 + 6645d9d commit 00650ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public class MessageResponse {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "hh:MM", timezone = "Asia/Seoul")
private LocalDateTime sendTime;

@Schema(description = "메시지 발신인 ID", example = "id2023")
private String senderId;
@Schema(description = "메시지 발신인 닉네임", example = "오븐조아")
private String sender;

@Builder
public MessageResponse(String content, LocalDateTime sendTime, String senderId) {
public MessageResponse(String content, LocalDateTime sendTime, String sender) {
this.content = content;
this.sendTime = sendTime;
this.senderId = senderId;
this.sender = sender;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void sendMessage(Long chatroomId, MessageRequest messageRequest) {
MessageResponse messageResponse = MessageResponse.builder()
.content(message.getContent())
.sendTime(message.getCreatedAt())
.senderId(user.getUsername())
.sender(user.getNickname())
.build();

template.convertAndSend("/sub/chatrooms/" + chatroomId + "/message", messageResponse);
Expand Down

0 comments on commit 00650ff

Please sign in to comment.