Skip to content

Commit

Permalink
refactor : BaseEntity Status 상태 추가 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
imenuuu committed Dec 3, 2023
1 parent 25a56d9 commit 8b7ccc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/kotlin/com/example/cmc_be/common/dto/BaseEntity.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.example.cmc_be.common.dto

import jakarta.persistence.Column
import jakarta.persistence.EntityListeners
import jakarta.persistence.MappedSuperclass
import jakarta.persistence.*
import org.hibernate.annotations.ColumnDefault
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import org.springframework.data.jpa.domain.support.AuditingEntityListener
Expand All @@ -19,4 +18,8 @@ abstract class BaseEntity {
@Column(name = "updatedAt")
@LastModifiedDate
var updatedAt: LocalDateTime? = null

@Enumerated(EnumType.STRING)
@ColumnDefault(value = "ACTIVE")
val status : Status = Status.ACTIVE
}
8 changes: 8 additions & 0 deletions src/main/kotlin/com/example/cmc_be/common/dto/Status.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.cmc_be.common.dto


enum class Status (
val value : String
){
ACTIVE("활성화"), INACTIVE("비활성화")
}

0 comments on commit 8b7ccc8

Please sign in to comment.