Skip to content

Commit

Permalink
Merge pull request #40 from catchroom/develop
Browse files Browse the repository at this point in the history
sender ํ•„๋“œ ์‚ญ์ œ
  • Loading branch information
sungjiwoon authored Jan 22, 2024
2 parents 1947082 + d4f9b15 commit 1000a9f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
configuration = FeignConfig.class
)
public interface MainFeignClient {
// user์˜ ๋‹‰๋„ค์ž„

@RequestMapping(method = RequestMethod.GET, value = "/accommodation/{accommodationId}")
AccommodationResponse getAccommodationDto(@PathVariable Long accommodationId);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.catchroom.chat.global.common;

public record SuccessMessage(
String Meassage
) {
public static SuccessMessage createSuccessMessage(String message) {
return new SuccessMessage(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class ChatMessageDto implements Serializable {

private MessageType type; // ๋ฉ”์‹œ์ง€ ํƒ€์ž…
private String roomId; // ๋ฐฉ ๋ฒˆํ˜ธ
private String sender; // ์ฑ„ํŒ…์„ ๋ณด๋‚ธ ์‚ฌ๋žŒ
private Long userId;
private String message; // ๋ฉ”์‹œ์ง€
private String time;
Expand All @@ -30,7 +29,6 @@ public class ChatMessageDto implements Serializable {
public static ChatMessageDto fromEntity(ChatMessage chatMessage) {
return ChatMessageDto.builder()
.type(chatMessage.getType())
.sender(chatMessage.getSender())
.userId(chatMessage.getUserId())
.roomId(chatMessage.getRoomId())
.time(chatMessage.getTime())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class ChatMessage {

private MessageType type; // ๋ฉ”์‹œ์ง€ ํƒ€์ž…
private String roomId; // ๋ฐฉ ๋ฒˆํ˜ธ
private String sender; // ์ฑ„ํŒ…์„ ๋ณด๋‚ธ ์‚ฌ๋žŒ
private Long userId; // ์ฑ„ํŒ… ๋ณด๋‚ธ userId
private String message; // ๋ฉ”์‹œ์ง€
private String time; // ๋ฉ”์‹œ์ง€ ๋ณด๋‚ธ ์‹œ๊ฐ„
Expand All @@ -26,7 +25,6 @@ public static ChatMessage of(ChatMessageDto dto) {
return ChatMessage.builder()
.type(dto.getType())
.roomId(dto.getRoomId())
.sender(dto.getSender())
.userId(dto.getUserId())
.message(dto.getMessage())
.time(LocalDateTime.now().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class ChatRoomRepository {

private static final String CHAT_ROOM = "CHAT_ROOM_LAST_MSG"; //์ฑ„ํŒ…๋ฐฉ
public static final String USER_COUNT = "USER_COUNT"; // ์ฑ„ํŒ…๋ฃธ์— ์ž…์žฅํ•œ ํด๋ผ์ด์–ธํŠธ์ˆ˜ ์ €์žฅ
public static final String ENTER_INFO = "ENTER_INFO"; // ์ฑ„ํŒ…๋ฃธ์— ์ž…์žฅํ•œ ํด๋ผ์ด์–ธํŠธ์˜ sessionId์™€ ์ฑ„ํŒ…๋ฃธ id๋ฅผ ๋งตํ•‘ํ•œ ์ •๋ณด ์ €์žฅ
public static final String ENTER_INFO = "ENTER_INFO";
// ์ฑ„ํŒ…๋ฃธ์— ์ž…์žฅํ•œ ํด๋ผ์ด์–ธํŠธ์˜ sessionId์™€ ์ฑ„ํŒ…๋ฃธ id๋ฅผ ๋งตํ•‘ํ•œ ์ •๋ณด ์ €์žฅ

// HashOperations<String, String, ChatRoom> : Redis์˜ ํ•ด์‹œ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ๋‹ค๋ฃธ.
// String ํƒ€์ž…์˜ key, String ํƒ€์ž…์˜ ํ•„๋“œ, chatRoom ๊ฐ์ฒด์˜ ๊ฐ’์œผ๋กœ ๊ตฌ์„ฑ๋œ ํ•ด์‹œ๋ฅผ ๋‹ค๋ฃฌ๋‹ค.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
@AllArgsConstructor
@Getter
public enum MessageType {
ENTER, TALK, QUIT, NEGO_REQ, NEGO_ALLOW, NEGO_DENIED
ENTER, TALK, QUIT, NEGO_REQ, NEGO_ALLOW, NEGO_DENIED, DELETE
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public MessageSubDto getChatRoomListAndMessage(
ChatMessageDto chatMessageDto = new ChatMessageDto();
chatMessageDto.setType(MessageType.ENTER);
chatMessageDto.setRoomId("test-room-id-kkkk");
chatMessageDto.setSender("ํ˜œ๋ฏผ");
chatMessageDto.setUserId(4L);
chatMessageDto.setMessage("test ๋ฉ”์„ธ์ง€ ๋ณด๋ƒ„");
chatMessageDto.setTime(String.valueOf(LocalDateTime.now()));
Expand Down

0 comments on commit 1000a9f

Please sign in to comment.