feat(push): add JPush integration for offline message push
Add JPush (极光推送) integration to enable push notifications for offline users. This includes: - New jpush client package with API for batch push notifications - Configuration for jpush (enabled, app_key, master_secret, production mode) - Updated push service to send messages via JPush when users are offline - Added PushChatMessage method with do-not-disturb checking - Integrated push service with chat service to notify offline users of new messages - Updated deployment workflow with JPush and related environment variables
This commit is contained in:
@@ -24,7 +24,7 @@ type DeviceToken struct {
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);index;not null" json:"user_id"` // 用户ID (UUID格式)
|
||||
DeviceID string `gorm:"type:varchar(100);not null" json:"device_id"` // 设备唯一标识
|
||||
DeviceType DeviceType `gorm:"type:varchar(20);not null" json:"device_type"` // 设备类型
|
||||
PushToken string `gorm:"type:varchar(256);not null" json:"push_token"` // 推送Token(FCM/APNs等)
|
||||
PushToken string `gorm:"type:varchar(256)" json:"push_token,omitempty"` // 推送Token(JPush RegistrationID等,Web端可为空)
|
||||
IsActive bool `gorm:"default:true" json:"is_active"` // 是否活跃
|
||||
DeviceName string `gorm:"type:varchar(100)" json:"device_name,omitempty"` // 设备名称(可选)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ const (
|
||||
PushChannelFCM PushChannel = "fcm" // Firebase Cloud Messaging
|
||||
PushChannelAPNs PushChannel = "apns" // Apple Push Notification service
|
||||
PushChannelHuawei PushChannel = "huawei" // 华为推送
|
||||
PushChannelJPush PushChannel = "jpush" // 极光推送
|
||||
)
|
||||
|
||||
// PushStatus 推送状态
|
||||
|
||||
Reference in New Issue
Block a user