-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.cmc.suppin.fcm.domain; | ||
|
||
import com.cmc.suppin.member.domain.Member; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicInsert; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@Builder | ||
@DynamicInsert | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
public class DeviceToken { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id", nullable = false) | ||
private Member member; | ||
|
||
@Column(nullable = false, unique = true) | ||
private String deviceToken; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private DeviceType deviceType; // ANDROID, IOS, OTHER | ||
|
||
@Column(nullable = false) | ||
private LocalDateTime createdAt; | ||
|
||
|
||
public void setMember(Member member) { | ||
this.member = member; | ||
} | ||
|
||
public void setToken(String token) { | ||
this.deviceToken = token; | ||
} | ||
|
||
public void setCreatedAt(LocalDateTime now) { | ||
this.createdAt = now; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters