feat: add post publish mode with review

This commit is contained in:
Tim
2025-07-01 13:09:47 +08:00
parent 227b375eb4
commit af1f3a9230
9 changed files with 209 additions and 3 deletions

View File

@@ -5,8 +5,12 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* Post entity representing an article posted by a user.
*/
@Entity
@Getter
@Setter
@@ -37,6 +41,10 @@ public class Post {
@Column(nullable = false)
private long views = 0;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private PostStatus status = PostStatus.PUBLISHED;
@PrePersist
protected void onCreate() {
this.createdAt = LocalDateTime.now();

View File

@@ -0,0 +1,9 @@
package com.openisle.model;
/**
* Status of a post during its lifecycle.
*/
public enum PostStatus {
PUBLISHED,
PENDING
}

View File

@@ -0,0 +1,9 @@
package com.openisle.model;
/**
* Application-wide article publish mode.
*/
public enum PublishMode {
DIRECT,
REVIEW
}