Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

030 chat room #115

Merged
merged 4 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/main/java/com/fab/banggabgo/dto/chat/ChatDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
@NoArgsConstructor
@AllArgsConstructor
public class ChatDto {

private String roomId;
private String userName;
private String userEmail;
private String msg;
private LocalDateTime createDate;

public static ChatDto toDto(Chat chat){
public static ChatDto toDto(Chat chat) {
return ChatDto.builder()
.roomId(chat.getRoomId())
.userName(chat.getUserEmail())
.userEmail(chat.getUserEmail())
.msg(chat.getMsg())
.createDate(chat.getCreateDate())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
@NoArgsConstructor
@AllArgsConstructor
public class RequestChatDto {
private String username;
private String userEmail;
private String msg;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public List<ChatDto> getChatLogs(String roomId){
public Chat saveMsg(String roomId,RequestChatDto dto){
var chat =Chat.builder()
.roomId(roomId)
.userEmail(dto.getUsername())
.userEmail(dto.getUserEmail())
.msg(dto.getMsg())
.build();
return chatRepository.save(chat);
Expand Down