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:
@@ -124,9 +124,11 @@ func (r *deviceTokenRepository) Upsert(token *model.DeviceToken) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// 更新现有记录
|
||||
// 更新现有记录(包括 user_id,设备可能在用户间转移)
|
||||
return r.db.Model(&existing).Updates(map[string]any{
|
||||
"user_id": token.UserID,
|
||||
"push_token": token.PushToken,
|
||||
"device_type": token.DeviceType,
|
||||
"is_active": true,
|
||||
"device_name": token.DeviceName,
|
||||
"last_used_at": time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user