erp-platform/api/src/Kurs.Platform.Application.Contracts/About/AboutDto.cs

68 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Abouts;
public class AboutDto : EntityDto<Guid>
{
public Guid? TenantId { get; set; }
[JsonIgnore]
public string StatsJson { get; set; }
public List<StatDto> StatsDto
{
get
{
if (!string.IsNullOrEmpty(StatsJson))
return JsonSerializer.Deserialize<List<StatDto>>(StatsJson);
return new List<StatDto>();
}
set { StatsJson = JsonSerializer.Serialize(value); }
}
[JsonIgnore]
public string DescriptionsJson { get; set; }
public List<string> DescriptionsDto
{
get
{
if (!string.IsNullOrEmpty(DescriptionsJson))
return JsonSerializer.Deserialize<List<string>>(DescriptionsJson);
return [];
}
set { DescriptionsJson = JsonSerializer.Serialize(value); }
}
[JsonIgnore]
public string SectionsJson { get; set; }
public List<SectionDto> SectionsDto
{
get
{
if (!string.IsNullOrEmpty(SectionsJson))
return JsonSerializer.Deserialize<List<SectionDto>>(SectionsJson);
return new List<SectionDto>();
}
set { SectionsJson = JsonSerializer.Serialize(value); }
}
public class StatDto
{
public string Icon { get; set; }
public string Value { get; set; } // number/string farkını normalize ettik
public string LabelKey { get; set; }
public bool? UseCounter { get; set; }
public int? CounterEnd { get; set; }
public string CounterSuffix { get; set; }
public int? CounterDuration { get; set; }
}
public class SectionDto
{
public string Key { get; set; }
public string DescKey { get; set; }
}
}