From 6b53659ad33d786961091153eca785e7bbd89100 Mon Sep 17 00:00:00 2001 From: bo Date: Mon, 6 May 2024 13:11:15 +0900 Subject: [PATCH] =?UTF-8?q?chore(coffeechat):=20CoffeeChat=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=EA=B0=84=EA=B3=BC=20?= =?UTF-8?q?State=20=EB=B3=80=EA=B2=BD=20=EC=8B=9C=EA=B0=84=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/coffeechat/domain/CoffeeChat.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main-server/src/main/java/com/sickgyun/server/coffeechat/domain/CoffeeChat.java b/main-server/src/main/java/com/sickgyun/server/coffeechat/domain/CoffeeChat.java index 0ca15ec..d7baeb4 100644 --- a/main-server/src/main/java/com/sickgyun/server/coffeechat/domain/CoffeeChat.java +++ b/main-server/src/main/java/com/sickgyun/server/coffeechat/domain/CoffeeChat.java @@ -1,5 +1,9 @@ package com.sickgyun.server.coffeechat.domain; +import java.time.LocalDateTime; + +import org.hibernate.annotations.CreationTimestamp; + import com.sickgyun.server.coffeechat.domain.value.State; import com.sickgyun.server.user.domain.User; @@ -41,10 +45,16 @@ public class CoffeeChat { @JoinColumn(name = "from_user_id") private User fromUser; + @CreationTimestamp + private LocalDateTime createdAt; + + private LocalDateTime statedChangedTime; + public CoffeeChat(String sendMessage, State state, User fromUser) { this.sendMessage = sendMessage; this.state = state; this.fromUser = fromUser; + this.createdAt = LocalDateTime.now(); } public void updateToUser(User toUser) { @@ -54,9 +64,11 @@ public void updateToUser(User toUser) { public void reject(State state, String rejectMessage) { this.state = state; this.rejectMessage = rejectMessage; + statedChangedTime = LocalDateTime.now(); } public void updateState(State state) { this.state = state; + statedChangedTime = LocalDateTime.now(); } }