Send type in news DTO.

This commit is contained in:
2025-11-14 15:18:09 +00:00
parent 2bb07845e1
commit 392c69350f

View File

@@ -32,13 +32,14 @@ public sealed class NewsDto : BaseDto<int>
{ {
public NewsDto() {} public NewsDto() {}
public NewsDto(int affectedId, string text, DateTime timestamp, string controller, string itemName) public NewsDto(int affectedId, string text, DateTime timestamp, string controller, string itemName, NewsType type)
{ {
AffectedId = affectedId; AffectedId = affectedId;
Text = text; Text = text;
Timestamp = timestamp; Timestamp = timestamp;
Controller = controller; Controller = controller;
ItemName = itemName; ItemName = itemName;
Type = type;
} }
[JsonPropertyName("type")] [JsonPropertyName("type")]
@@ -46,11 +47,11 @@ public sealed class NewsDto : BaseDto<int>
[JsonPropertyName("affected_id")] [JsonPropertyName("affected_id")]
public int AffectedId { get; set; } public int AffectedId { get; set; }
[JsonPropertyName("controller")] [JsonPropertyName("controller")]
public string Controller { get; } public string Controller { get; set; }
[JsonPropertyName("item_name")] [JsonPropertyName("item_name")]
public string ItemName { get; } public string ItemName { get; set; }
[JsonPropertyName("text")] [JsonPropertyName("text")]
public string Text { get; } public string Text { get; set; }
[JsonPropertyName("timestamp")] [JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; } public DateTime Timestamp { get; set; }
} }