From 1436911d2da6e77e6be7fe36c3c9858dbc80d146 Mon Sep 17 00:00:00 2001 From: Andriy <30056636+West14@users.noreply.github.com> Date: Sun, 9 Feb 2025 19:15:27 +0200 Subject: [PATCH] fix: add json property names, class -> record --- modules/ContentStore/Model/AnimalImage.cs | 13 +++++++++---- modules/ContentStore/Model/OBoobsItem.cs | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/modules/ContentStore/Model/AnimalImage.cs b/modules/ContentStore/Model/AnimalImage.cs index 4f3b619..2bbcea1 100644 --- a/modules/ContentStore/Model/AnimalImage.cs +++ b/modules/ContentStore/Model/AnimalImage.cs @@ -1,7 +1,12 @@ -namespace West.TelegramBot.ContentStore.Model; +using System.Text.Json.Serialization; -public class AnimalImage +namespace West.TelegramBot.ContentStore.Model; + +public record AnimalImage { - public string Id { get; set; } = null!; - public string Url { get; set; } = null!; + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("url")] + public required string Url { get; set; } } \ No newline at end of file diff --git a/modules/ContentStore/Model/OBoobsItem.cs b/modules/ContentStore/Model/OBoobsItem.cs index 947016f..e85c8ad 100644 --- a/modules/ContentStore/Model/OBoobsItem.cs +++ b/modules/ContentStore/Model/OBoobsItem.cs @@ -1,10 +1,21 @@ -namespace West.TelegramBot.ContentStore.Model; +using System.Text.Json.Serialization; -public class OBoobsItem +namespace West.TelegramBot.ContentStore.Model; + +public record OBoobsItem { + [JsonPropertyName("id")] public int Id { get; set; } + + [JsonPropertyName("rank")] public int Rank { get; set; } + + [JsonPropertyName("author")] public string? Author { get; set; } + + [JsonPropertyName("model")] public string? Model { get; set; } + + [JsonPropertyName("rank")] public string Preview { get; set; } = string.Empty; } \ No newline at end of file