2026-04-21 22:07:29 +08:00
|
|
|
package com.xuqm.push.entity;
|
|
|
|
|
|
|
|
|
|
import jakarta.persistence.Column;
|
|
|
|
|
import jakarta.persistence.Entity;
|
|
|
|
|
import jakarta.persistence.EnumType;
|
|
|
|
|
import jakarta.persistence.Enumerated;
|
|
|
|
|
import jakarta.persistence.Id;
|
|
|
|
|
import jakarta.persistence.Table;
|
|
|
|
|
import jakarta.persistence.UniqueConstraint;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
|
@Table(name = "push_device_token",
|
2026-05-05 17:54:59 +08:00
|
|
|
uniqueConstraints = @UniqueConstraint(columnNames = {"appId", "userId", "deviceId"}))
|
2026-04-21 22:07:29 +08:00
|
|
|
public class DeviceTokenEntity {
|
|
|
|
|
|
2026-05-01 21:27:39 +08:00
|
|
|
public enum Vendor {
|
2026-05-02 22:57:55 +08:00
|
|
|
HUAWEI, XIAOMI, OPPO, VIVO, HONOR, HARMONY, FCM, APNS
|
2026-05-01 21:27:39 +08:00
|
|
|
}
|
2026-04-21 22:07:29 +08:00
|
|
|
|
|
|
|
|
@Id
|
|
|
|
|
private String id;
|
|
|
|
|
|
|
|
|
|
@Column(nullable = false, length = 64)
|
|
|
|
|
private String appId;
|
|
|
|
|
|
|
|
|
|
@Column(nullable = false, length = 128)
|
|
|
|
|
private String userId;
|
|
|
|
|
|
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
|
|
|
@Column(nullable = false, length = 16)
|
|
|
|
|
private Vendor vendor;
|
|
|
|
|
|
|
|
|
|
@Column(nullable = false, length = 512)
|
|
|
|
|
private String token;
|
|
|
|
|
|
2026-05-05 17:54:59 +08:00
|
|
|
@Column(length = 32)
|
|
|
|
|
private String platform;
|
|
|
|
|
|
|
|
|
|
@Column(length = 128)
|
|
|
|
|
private String deviceId;
|
|
|
|
|
|
|
|
|
|
@Column(length = 64)
|
|
|
|
|
private String brand;
|
|
|
|
|
|
|
|
|
|
@Column(length = 128)
|
|
|
|
|
private String model;
|
|
|
|
|
|
|
|
|
|
@Column(length = 64)
|
|
|
|
|
private String osVersion;
|
|
|
|
|
|
|
|
|
|
@Column(length = 64)
|
|
|
|
|
private String appVersion;
|
|
|
|
|
|
2026-04-29 12:33:25 +08:00
|
|
|
@Column(nullable = false)
|
|
|
|
|
private boolean receivePush = true;
|
|
|
|
|
|
2026-05-05 17:54:59 +08:00
|
|
|
@Column
|
|
|
|
|
private LocalDateTime lastLoginAt;
|
|
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
@Column(nullable = false)
|
|
|
|
|
private LocalDateTime createdAt;
|
|
|
|
|
|
|
|
|
|
@Column(nullable = false)
|
|
|
|
|
private LocalDateTime updatedAt;
|
|
|
|
|
|
|
|
|
|
public String getId() { return id; }
|
|
|
|
|
public void setId(String 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 Vendor getVendor() { return vendor; }
|
|
|
|
|
public void setVendor(Vendor vendor) { this.vendor = vendor; }
|
|
|
|
|
|
|
|
|
|
public String getToken() { return token; }
|
|
|
|
|
public void setToken(String token) { this.token = token; }
|
|
|
|
|
|
2026-05-05 17:54:59 +08:00
|
|
|
public String getPlatform() { return platform; }
|
|
|
|
|
public void setPlatform(String platform) { this.platform = platform; }
|
|
|
|
|
|
|
|
|
|
public String getDeviceId() { return deviceId; }
|
|
|
|
|
public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
|
|
|
|
|
|
|
|
|
|
public String getBrand() { return brand; }
|
|
|
|
|
public void setBrand(String brand) { this.brand = brand; }
|
|
|
|
|
|
|
|
|
|
public String getModel() { return model; }
|
|
|
|
|
public void setModel(String model) { this.model = model; }
|
|
|
|
|
|
|
|
|
|
public String getOsVersion() { return osVersion; }
|
|
|
|
|
public void setOsVersion(String osVersion) { this.osVersion = osVersion; }
|
|
|
|
|
|
|
|
|
|
public String getAppVersion() { return appVersion; }
|
|
|
|
|
public void setAppVersion(String appVersion) { this.appVersion = appVersion; }
|
|
|
|
|
|
2026-04-29 12:33:25 +08:00
|
|
|
public boolean isReceivePush() { return receivePush; }
|
|
|
|
|
public void setReceivePush(boolean receivePush) { this.receivePush = receivePush; }
|
|
|
|
|
|
2026-05-05 17:54:59 +08:00
|
|
|
public LocalDateTime getLastLoginAt() { return lastLoginAt; }
|
|
|
|
|
public void setLastLoginAt(LocalDateTime lastLoginAt) { this.lastLoginAt = lastLoginAt; }
|
|
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
public LocalDateTime getCreatedAt() { return createdAt; }
|
|
|
|
|
public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
|
|
|
|
|
|
|
|
|
|
public LocalDateTime getUpdatedAt() { return updatedAt; }
|
|
|
|
|
public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
|
|
|
|
|
}
|