51 行
1.5 KiB
Java
51 行
1.5 KiB
Java
|
|
package com.xuqm.im.entity;
|
||
|
|
|
||
|
|
import jakarta.persistence.Column;
|
||
|
|
import jakarta.persistence.Entity;
|
||
|
|
import jakarta.persistence.GeneratedValue;
|
||
|
|
import jakarta.persistence.GenerationType;
|
||
|
|
import jakarta.persistence.Id;
|
||
|
|
import jakarta.persistence.Table;
|
||
|
|
import jakarta.persistence.UniqueConstraint;
|
||
|
|
import org.hibernate.annotations.CreationTimestamp;
|
||
|
|
|
||
|
|
import java.time.Instant;
|
||
|
|
|
||
|
|
@Entity
|
||
|
|
@Table(name = "im_friends",
|
||
|
|
uniqueConstraints = @UniqueConstraint(columnNames = {"appId", "userId", "friendId"}))
|
||
|
|
public class ImFriendEntity {
|
||
|
|
|
||
|
|
@Id
|
||
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||
|
|
private Long id;
|
||
|
|
|
||
|
|
@Column(nullable = false, length = 64)
|
||
|
|
private String appId;
|
||
|
|
|
||
|
|
@Column(nullable = false, length = 128)
|
||
|
|
private String userId;
|
||
|
|
|
||
|
|
@Column(nullable = false, length = 128)
|
||
|
|
private String friendId;
|
||
|
|
|
||
|
|
@CreationTimestamp
|
||
|
|
@Column(nullable = false, updatable = false)
|
||
|
|
private Instant createdAt;
|
||
|
|
|
||
|
|
public Long getId() { return id; }
|
||
|
|
public void setId(Long id) { this.id = id; }
|
||
|
|
|
||
|
|
public String getAppId() { return appId; }
|
||
|
|
public void setAppId(String appId) { this.appId = appId; }
|
||
|
|
|
||
|
|
public String getUserId() { return userId; }
|
||
|
|
public void setUserId(String userId) { this.userId = userId; }
|
||
|
|
|
||
|
|
public String getFriendId() { return friendId; }
|
||
|
|
public void setFriendId(String friendId) { this.friendId = friendId; }
|
||
|
|
|
||
|
|
public Instant getCreatedAt() { return createdAt; }
|
||
|
|
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||
|
|
}
|