-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserBadge.java
More file actions
41 lines (32 loc) · 997 Bytes
/
UserBadge.java
File metadata and controls
41 lines (32 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.gpt.geumpumtabackend.badge.domain;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Entity
@Getter
@NoArgsConstructor
@Table(
name = "user_badge",
uniqueConstraints = @UniqueConstraint(name="uk_user_badge", columnNames = {"user_id", "badge_id"})
)
public class UserBadge {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "user_id")
private Long userId;
@Column(name = "badge_id")
private Long badgeId;
private LocalDateTime awardedAt;
private LocalDateTime notifiedAt;
public UserBadge(Long userId, Long badgeId, LocalDateTime awardedAt, LocalDateTime notifiedAt) {
this.userId = userId;
this.badgeId = badgeId;
this.awardedAt = awardedAt;
this.notifiedAt = notifiedAt;
}
public void markNotified(LocalDateTime notifiedAt) {
this.notifiedAt = notifiedAt;
}
}