first commit

This commit is contained in:
2025-02-26 23:42:19 +01:00
commit 777ea98be1
283 changed files with 88266 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Serialization;
using Confluent.Kafka;
namespace Kafka.Lib.Auth;
public class UserChangeMessageType : IMessageType
{
private string? _userId;
private Dictionary<string, string> _changes = new Dictionary<string, string>();
private string? _id;
private readonly string _eventType = "NewUser";
public string? UserId
{
get => _userId;
set => _userId = value;
}
public Dictionary<string, string> Changes
{
get => _changes;
set => _changes = value;
}
public string? Id
{
get => _id;
set => _id = value;
}
public string EventType => _eventType;
[JsonIgnore]
public string Text
{
get => JsonSerializer.Serialize(this);
set
{
var val = JsonSerializer.Deserialize<UserChangeMessageType>(value);
if (val == null) throw new MessageNullException();
_changes = val.Changes;
_userId = val.UserId;
_id = val.Id;
}
}
}