Add category module and require post category

This commit is contained in:
Tim
2025-06-30 23:07:15 +08:00
parent 4f24934a45
commit 5dd29239c9
10 changed files with 163 additions and 7 deletions

View File

@@ -30,6 +30,10 @@ public class Post {
@JoinColumn(name = "author_id")
private User author;
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "category_id")
private Category category;
@Column(nullable = false)
private long views = 0;