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

[fix]Socket image 필드 추가 #160

Merged
merged 1 commit into from
May 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class RoomMessageElementResponseDto {
private ChatUserResponseDto user;
private String content;
private String time;
private String image;

public static List<RoomMessageElementResponseDto> listOf(List<ChatContent> chatContentList,String roomName,TriFunction<String, String, ChatUser> formatter, TriFunction<String,String,Boolean> function,String ownerSession) {
return chatContentList.stream()
Expand All @@ -31,12 +32,14 @@ public static RoomMessageElementResponseDto of(ChatContent chatContent, String r
.user(ChatUserResponseDto.of(chatUser,function.apply(ownerSession,chatUser.getSessionId())))
.content(chatContent.getContent())
.time(chatContent.getTime().toString())
.image(chatContent.getImage())
.build();
} else {
return RoomMessageElementResponseDto.builder()
.user(ChatUserResponseDto.builder().build())
.content(chatContent.getContent())
.time(chatContent.getTime().toString())
.image(chatContent.getImage())
.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ChatMessageRoomResponseDto createSendMessageContentInRoom(String roomName
Room room = getChatBySessionsInRoom(roomName, chatMessageRoomRequestDto.getChatSession());
User user = userRepository.findBySessionId(chatMessageRoomRequestDto.getChatSession()).orElseThrow();
// String images = awsService.uploadImageToS3(modifiedImageString);
ChatContent chatContent = createChatContent(chatMessageRoomRequestDto.getFromUserName(), chatMessageRoomRequestDto.getContent(), room);
ChatContent chatContent = createChatContent(chatMessageRoomRequestDto.getFromUserName(), chatMessageRoomRequestDto.getContent(), room, chatMessageRoomRequestDto.getImage());

ChatMessageElementResponseDto chatMessage = ChatMessageElementResponseDto.of(chatContent, chatMessageRoomRequestDto.getChatSession(), user.getProfile(), chatMessageRoomRequestDto.getImage(), validate(room.getOwnerSession(),chatMessageRoomRequestDto.getChatSession()));
List<String> sessionIdList = getSessionIdListInRoom(roomName, chatMessageRoomRequestDto.getChatSession());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
public class ChatContent {
private String userName;
private String content;
private String image;
private LocalDateTime time;

public static ChatContent createChatContent(String userName, String content, Chat chat) {
public static ChatContent createChatContent(String userName, String content,Chat chat) {
ChatContent chatContent = ChatContent.builder()
.userName(userName)
.content(content)
Expand All @@ -21,7 +22,7 @@ public static ChatContent createChatContent(String userName, String content, Cha
chat.addChatContent(chatContent);
return chatContent;
}
public static ChatContent createChatContent(String userName, String content, Room room) {
public static ChatContent createChatContent(String userName, String content, Room room,String image) {
ChatContent chatContent = ChatContent.builder()
.userName(userName)
.content(content)
Expand Down