From 0fb652664fdcc53bf60907b8aeade28513e14caf Mon Sep 17 00:00:00 2001 From: kislovdm Date: Tue, 10 Mar 2026 16:44:36 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PepperBot/Domain/Deal.cs | 1 + PepperBot/Infrastructure/Pepper/PepperClient.cs | 4 ++++ PepperBot/Infrastructure/Telegram/TelegramNotifier.cs | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PepperBot/Domain/Deal.cs b/PepperBot/Domain/Deal.cs index 39a4268..7c6dcff 100644 --- a/PepperBot/Domain/Deal.cs +++ b/PepperBot/Domain/Deal.cs @@ -10,6 +10,7 @@ public class Deal public DateTime CreatedAt { get; set; } public long CreatedAtInMillis { get; set; } public string DealUrl { get; set; } = string.Empty; + public string Permalink { get; set; } = string.Empty; public string StoreName { get; set; } = string.Empty; public string StorePermalink { get; set; } = string.Empty; } diff --git a/PepperBot/Infrastructure/Pepper/PepperClient.cs b/PepperBot/Infrastructure/Pepper/PepperClient.cs index 3a665f4..7dd8ab5 100644 --- a/PepperBot/Infrastructure/Pepper/PepperClient.cs +++ b/PepperBot/Infrastructure/Pepper/PepperClient.cs @@ -73,6 +73,7 @@ public class PepperClient : IPepperClient CreatedAt = dto.CreatedAt ?? DateTimeOffset.FromUnixTimeMilliseconds(dto.CreatedAtInMillis).UtcDateTime, CreatedAtInMillis = dto.CreatedAtInMillis, DealUrl = dto.DealUrl ?? string.Empty, + Permalink = dto.Permalink ?? string.Empty, StoreName = dto.Store?.Name ?? string.Empty, StorePermalink = dto.Store?.Permalink ?? string.Empty }; @@ -110,6 +111,9 @@ public class PepperClient : IPepperClient [JsonPropertyName("deal_url")] public string? DealUrl { get; set; } + [JsonPropertyName("permalink")] + public string? Permalink { get; set; } + [JsonPropertyName("store")] public PepperStore? Store { get; set; } } diff --git a/PepperBot/Infrastructure/Telegram/TelegramNotifier.cs b/PepperBot/Infrastructure/Telegram/TelegramNotifier.cs index 9186214..2a61774 100644 --- a/PepperBot/Infrastructure/Telegram/TelegramNotifier.cs +++ b/PepperBot/Infrastructure/Telegram/TelegramNotifier.cs @@ -281,7 +281,11 @@ public class TelegramNotifier : ITelegramNotifier textBuilder.AppendLine($"Магазин: {deal.StoreName}"); textBuilder.AppendLine(); textBuilder.AppendLine($"Товар в магазине: {deal.DealUrl}"); - textBuilder.AppendLine($"Открыть на Pepper.ru: https://www.pepper.ru/deals/{deal.StorePermalink}"); + + if (!string.IsNullOrEmpty(deal.Permalink)) + { + textBuilder.AppendLine($"Открыть на Pepper.ru: https://www.pepper.ru/deals/{deal.Permalink}"); + } try {