68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
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; }
|
||
}
|
||
}
|