diff --git a/internal/service/push_service.go b/internal/service/push_service.go index 795a155..ee4d459 100644 --- a/internal/service/push_service.go +++ b/internal/service/push_service.go @@ -1,4 +1,4 @@ -package service +package service import ( "context" @@ -153,7 +153,7 @@ func (s *pushServiceImpl) pushViaWebSocket(ctx context.Context, userID string, m "type": string(message.SystemType), "content": content, "extra": map[string]any{}, - "created_at": message.CreatedAt.UnixMilli(), + "created_at": message.CreatedAt.Format("2006-01-02T15:04:05Z07:00"), } // 填充额外数据 @@ -454,7 +454,7 @@ func (s *pushServiceImpl) pushSystemViaWebSocket(ctx context.Context, userID str "title": title, "content": content, "data": data, - "created_at": time.Now().UnixMilli(), + "created_at": time.Now().Format("2006-01-02T15:04:05Z07:00"), } s.wsHub.PublishToUser(userID, "system_notification", sysMsg) return true @@ -483,7 +483,7 @@ func (s *pushServiceImpl) pushSystemNotificationViaWebSocket(ctx context.Context "title": notification.Title, "content": notification.Content, "extra": map[string]any{}, - "created_at": notification.CreatedAt.UnixMilli(), + "created_at": notification.CreatedAt.Format("2006-01-02T15:04:05Z07:00"), } // 填充额外数据