From 62336c9e7a416f75303c1152597be0766a11933e Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 10 Jul 2025 09:51:03 +0330 Subject: [PATCH] refactor XPushMessage and handle it's side affects ... --- Base/XBaseHub.cs | 4 ++-- Constants/XPushType.cs | 2 ++ Models/XPushMessage.cs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Base/XBaseHub.cs b/Base/XBaseHub.cs index b6b23f1..b15aac2 100644 --- a/Base/XBaseHub.cs +++ b/Base/XBaseHub.cs @@ -105,9 +105,9 @@ namespace xPushService.Base { // Actor = actor, Payload = connectionId, - Type = XPushType.System, TimeStamp = DateTime.UtcNow, - Topic = (int) XPushType.System, + Type = XPushType.System.GetStringValue(), + Topic = XPushType.System.GetStringValue(), Action = XBasePushAction.NotifyNewConnection.GetStringValue (), Message = $"a new connection stablished by {connectionId} ...", }; diff --git a/Constants/XPushType.cs b/Constants/XPushType.cs index 59394a0..587593a 100644 --- a/Constants/XPushType.cs +++ b/Constants/XPushType.cs @@ -6,9 +6,11 @@ namespace xPushService.Constants { /// public enum XPushType { /// System Type Notifications Relate Only to System + [StringValue("system")] System, /// User Specific Types Of Push Notifications + [StringValue("user")] User } diff --git a/Models/XPushMessage.cs b/Models/XPushMessage.cs index 93d6bfa..aa935ae 100644 --- a/Models/XPushMessage.cs +++ b/Models/XPushMessage.cs @@ -7,14 +7,14 @@ namespace xPushService.Models { /// Specify the Type of Push Notification ... /// /// - public XPushType Type { get; set; } + public string Type { get; set; } /// /// Specify the Topic of PushNotification ... /// NOTE: XPushTopic enum contains default Values and User can Extends it ... /// /// - public int Topic { get; set; } + public string Topic { get; set; } /// /// Specify the Action Name by passing String Values ...