diff --git a/src/main/kotlin/com/example/cmc_be/common/dto/BaseEntity.kt b/src/main/kotlin/com/example/cmc_be/common/dto/BaseEntity.kt index 5defed3..e412900 100644 --- a/src/main/kotlin/com/example/cmc_be/common/dto/BaseEntity.kt +++ b/src/main/kotlin/com/example/cmc_be/common/dto/BaseEntity.kt @@ -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 @@ -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 } \ No newline at end of file diff --git a/src/main/kotlin/com/example/cmc_be/common/dto/Status.kt b/src/main/kotlin/com/example/cmc_be/common/dto/Status.kt new file mode 100644 index 0000000..4f3ce60 --- /dev/null +++ b/src/main/kotlin/com/example/cmc_be/common/dto/Status.kt @@ -0,0 +1,8 @@ +package com.example.cmc_be.common.dto + + +enum class Status ( + val value : String +){ + ACTIVE("활성화"), INACTIVE("비활성화") +} \ No newline at end of file