간단하게 고유 아이디, 제목, 내용을 저장하는 엔티티를 생성하였습니다.
Memo
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
class Memo(title: String, content: String) {
@Id @GeneratedValue
@Column(name = "memo_id", nullable = false)
val id: Long? = null
var title: String
var content: String
val createDate: LocalDateTime
init {
this.title = title
this.content = content
this.createDate = LocalDateTime.now()
}
}
MemoDTO
class MemoDTO(title: String, content: String) {
var title: String
var content: String
init {
this.title = title
this.content = content
}
}