65 lines
1.4 KiB
C#
65 lines
1.4 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using Kafka.Lib.Auth.Model;
|
|
|
|
namespace Kafka.Lib.Auth;
|
|
|
|
public class UserChangeClaimsMessageType : IMessageType
|
|
{
|
|
private string? _userId;
|
|
private List<ClaimChagesModel>? _claimChages;
|
|
private string? _id;
|
|
private bool _isSuccess = false;
|
|
private Dictionary<string,string> _errors = new ();
|
|
|
|
public string? UserId
|
|
{
|
|
get => _userId;
|
|
set => _userId = value;
|
|
}
|
|
|
|
public List<ClaimChagesModel>? ClaimChages
|
|
{
|
|
get => _claimChages;
|
|
set => _claimChages = value;
|
|
}
|
|
|
|
public string? Id
|
|
{
|
|
get => _id;
|
|
set => _id = value;
|
|
}
|
|
|
|
public string? EventType { get; } = "UserChangeClaims";
|
|
|
|
public bool IsSuccess
|
|
{
|
|
get => _isSuccess;
|
|
set => _isSuccess = value;
|
|
}
|
|
|
|
public Dictionary<string, string> Errors
|
|
{
|
|
get => _errors;
|
|
set => _errors = value;
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public string Text
|
|
{
|
|
get => JsonSerializer.Serialize(this);
|
|
set
|
|
{
|
|
if (!string.IsNullOrEmpty(value))
|
|
{
|
|
var obj = JsonSerializer.Deserialize<UserChangeClaimsMessageType>(value);
|
|
|
|
if (obj != null)
|
|
{
|
|
UserId = obj.UserId;
|
|
ClaimChages = obj.ClaimChages;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |