feat: track poll votes

This commit is contained in:
Tim
2025-08-30 12:03:17 +08:00
parent 5adee4db0e
commit 23582934fa
5 changed files with 52 additions and 9 deletions

View File

@@ -30,11 +30,8 @@ public class PollPost extends Post {
@Column(name = "vote_count")
private Map<Integer, Integer> votes = new HashMap<>();
@ManyToMany
@JoinTable(name = "poll_participants",
joinColumns = @JoinColumn(name = "post_id"),
inverseJoinColumns = @JoinColumn(name = "user_id"))
private Set<User> participants = new HashSet<>();
@OneToMany(mappedBy = "post", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<PollParticipant> participants = new HashSet<>();
@Column
private LocalDateTime endTime;