mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-24 07:00:49 +08:00
Add subscription feature
This commit is contained in:
27
src/main/java/com/openisle/model/CommentSubscription.java
Normal file
27
src/main/java/com/openisle/model/CommentSubscription.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.openisle.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/** Subscription to a comment for replies notifications. */
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Table(name = "comment_subscriptions",
|
||||
uniqueConstraints = @UniqueConstraint(columnNames = {"user_id", "comment_id"}))
|
||||
public class CommentSubscription {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(name = "user_id")
|
||||
private User user;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(name = "comment_id")
|
||||
private Comment comment;
|
||||
}
|
||||
Reference in New Issue
Block a user