first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Kafka.Lib.Warehouse;
|
||||
|
||||
public class WarehouseChangeMessageType : IMessageType
|
||||
{
|
||||
public string? WarehouseId { get; set; }
|
||||
public Dictionary<string, string> Changes { get; set; } = new();
|
||||
|
||||
public string? Id { get; set; }
|
||||
|
||||
public string? EventType { get; } = "WarehouseChange";
|
||||
|
||||
public string Text
|
||||
{
|
||||
get => JsonSerializer.Serialize(this);
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
var obj = JsonSerializer.Deserialize<WarehouseChangeMessageType>(value);
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
WarehouseId = obj.WarehouseId;
|
||||
Changes = obj.Changes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user