mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-23 14:40:49 +08:00
feat: add post publish mode with review
This commit is contained in:
@@ -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();
|
||||
|
||||
9
src/main/java/com/openisle/model/PostStatus.java
Normal file
9
src/main/java/com/openisle/model/PostStatus.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.openisle.model;
|
||||
|
||||
/**
|
||||
* Status of a post during its lifecycle.
|
||||
*/
|
||||
public enum PostStatus {
|
||||
PUBLISHED,
|
||||
PENDING
|
||||
}
|
||||
9
src/main/java/com/openisle/model/PublishMode.java
Normal file
9
src/main/java/com/openisle/model/PublishMode.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.openisle.model;
|
||||
|
||||
/**
|
||||
* Application-wide article publish mode.
|
||||
*/
|
||||
public enum PublishMode {
|
||||
DIRECT,
|
||||
REVIEW
|
||||
}
|
||||
Reference in New Issue
Block a user