49 lines
931 B
Java
49 lines
931 B
Java
package com.aiteacher.chat;
|
|
|
|
import jakarta.persistence.*;
|
|
import java.time.Instant;
|
|
import java.util.UUID;
|
|
|
|
@Entity
|
|
@Table(name = "chat_session")
|
|
public class ChatSession {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.UUID)
|
|
private UUID id;
|
|
|
|
@Column(name = "topic_id", length = 100)
|
|
private String topicId;
|
|
|
|
@Column(name = "created_at", nullable = false)
|
|
private Instant createdAt;
|
|
|
|
public ChatSession() {
|
|
}
|
|
|
|
public ChatSession(String topicId) {
|
|
this.topicId = topicId;
|
|
this.createdAt = Instant.now();
|
|
}
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getTopicId() {
|
|
return topicId;
|
|
}
|
|
|
|
public void setTopicId(String topicId) {
|
|
this.topicId = topicId;
|
|
}
|
|
|
|
public Instant getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(Instant createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
}
|