Skip to content

Commit

Permalink
[performance] Chat Index Long 타입 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ghkdqhrbals committed Jan 3, 2024
1 parent f8da8fb commit 28ca728
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public ResponseEntity<?> changeUserStatus(@RequestBody RequestChangeUserStatusDT
*/
private Chatting createChatting(Room room, User user, String msg) {
Chatting chatting = new Chatting();
chatting.setId(UUID.randomUUID().toString());
chatting.setRoom(room);
chatting.setSendUser(user);
chatting.setCreatedAt(LocalDateTime.now());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@Setter
public class Chatting extends BaseTime {
@Id
private String id;
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "chatting_seq")
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ROOM_ID")
private Room room;
Expand All @@ -28,7 +29,7 @@ public class Chatting extends BaseTime {
private String message;

@Builder
public Chatting(String id, Room room, User sendUser, String message, LocalDateTime createdAt) {
public Chatting(Long id, Room room, User sendUser, String message, LocalDateTime createdAt) {
this.id = id;
this.room = room;
this.sendUser = sendUser;
Expand All @@ -46,7 +47,7 @@ public Chatting() {
*/
public ChatRequest.ChatRecordDTO toChatRecordDTO() {
return ChatRequest.ChatRecordDTO.builder()
.id(this.id)
.id(String.valueOf(this.id))
.roomId(this.room.getRoomId())
.sendUserId(this.sendUser.getUserId())
.sendUserName(this.sendUser.getUserName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public ChatRecordDTO save(RequestAddChatMessageDTO req, String userId) throws Cu
.orElseThrow(() -> new CustomException(CANNOT_FIND_USER));

Chatting chatting = Chatting.builder()
.id(UUID.randomUUID().toString())
.room(room)
.sendUser(user)
.message(req.getMessage())
Expand Down

0 comments on commit 28ca728

Please sign in to comment.