- 新增 XuqmGroup 部署文档,包含部署方案、架构建议和部署步骤 - 添加安全设计规范,涵盖密码安全、AppSecret验证和服务端API认证 - 补充平台REST API规范,定义Server-to-Server调用接口和错误码 - 创建Java IM服务端SDK计划文档,规划Maven包发布和接口实现
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 = {"appKey", "userId", "deviceId"}))
|
|
public class DeviceTokenEntity {
|
|
|
|
public enum Vendor {
|
|
HUAWEI, XIAOMI, OPPO, VIVO, HONOR, HARMONY, APNS
|
|
}
|
|
|
|
@Id
|
|
private String id;
|
|
|
|
@Column(nullable = false, length = 64)
|
|
private String appKey;
|
|
|
|
@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 getAppKey() { return appKey; }
|
|
public void setAppKey(String appKey) { this.appKey = appKey; }
|
|
|
|
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; }
|
|
}
|