mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 22:21:09 +08:00
feat: add new reaction types and enforce single reaction per type
This commit is contained in:
@@ -12,7 +12,11 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Table(name = "reactions")
|
||||
@Table(name = "reactions",
|
||||
uniqueConstraints = {
|
||||
@UniqueConstraint(columnNames = {"user_id", "post_id", "type"}),
|
||||
@UniqueConstraint(columnNames = {"user_id", "comment_id", "type"})
|
||||
})
|
||||
public class Reaction {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -7,5 +7,13 @@ public enum ReactionType {
|
||||
LIKE,
|
||||
DISLIKE,
|
||||
RECOMMEND,
|
||||
ANGRY
|
||||
ANGRY,
|
||||
FLUSHED,
|
||||
STAR_STRUCK,
|
||||
ROFL,
|
||||
HOLDING_BACK_TEARS,
|
||||
MIND_BLOWN,
|
||||
POOP,
|
||||
CLOWN,
|
||||
SKULL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user