- 实现了华为 HMS 推送服务集成 - 实现了小米推送服务集成 - 实现了 OPPO 推送服务集成 - 实现了 vivo 推送服务集成 - 实现了荣耀推送服务集成 - 实现了 FCM 推送服务集成 - 添加了统一的厂商推送接口和检测机制 - 添加了推送配置 API 和存储管理 - 添加了推送令牌管理和设备注册功能 - 添加了模拟器环境的推送测试用例
112 行
3.4 KiB
Java
112 行
3.4 KiB
Java
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",
|
|
uniqueConstraints = @UniqueConstraint(columnNames = {"appId", "userId", "deviceId"}))
|
|
public class DeviceTokenEntity {
|
|
|
|
public enum Vendor {
|
|
HUAWEI, XIAOMI, OPPO, VIVO, HONOR, HARMONY, FCM, APNS
|
|
}
|
|
|
|
@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;
|
|
|
|
@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;
|
|
|
|
@Column(nullable = false)
|
|
private boolean receivePush = true;
|
|
|
|
@Column
|
|
private LocalDateTime lastLoginAt;
|
|
|
|
@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; }
|
|
|
|
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; }
|
|
|
|
public boolean isReceivePush() { return receivePush; }
|
|
public void setReceivePush(boolean receivePush) { this.receivePush = receivePush; }
|
|
|
|
public LocalDateTime getLastLoginAt() { return lastLoginAt; }
|
|
public void setLastLoginAt(LocalDateTime lastLoginAt) { this.lastLoginAt = lastLoginAt; }
|
|
|
|
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; }
|
|
}
|