- DashboardKpiDto에 success_rate_change, device_count_change, today_sent_change_rate 필드 추가 - StatsService.GetDashboardAsync에 직전 기간 성공률 변화, 오늘 신규 디바이스 수, 발송 변화율 계산 로직 구현 Closes #262
85 lines
2.3 KiB
C#
85 lines
2.3 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace SPMS.Application.DTOs.Stats;
|
|
|
|
public class DashboardResponseDto
|
|
{
|
|
[JsonPropertyName("kpi")]
|
|
public DashboardKpiDto Kpi { get; set; } = new();
|
|
|
|
[JsonPropertyName("daily")]
|
|
public List<DailyStatItemDto> Daily { get; set; } = [];
|
|
|
|
[JsonPropertyName("hourly")]
|
|
public List<HourlyStatItemDto> Hourly { get; set; } = [];
|
|
|
|
[JsonPropertyName("platform_share")]
|
|
public List<PlatformStatDto> PlatformShare { get; set; } = [];
|
|
|
|
[JsonPropertyName("top_messages")]
|
|
public List<TopMessageDto> TopMessages { get; set; } = [];
|
|
}
|
|
|
|
public class DashboardKpiDto
|
|
{
|
|
[JsonPropertyName("total_devices")]
|
|
public int TotalDevices { get; set; }
|
|
|
|
[JsonPropertyName("active_devices")]
|
|
public int ActiveDevices { get; set; }
|
|
|
|
[JsonPropertyName("total_messages")]
|
|
public int TotalMessages { get; set; }
|
|
|
|
[JsonPropertyName("total_send")]
|
|
public long TotalSend { get; set; }
|
|
|
|
[JsonPropertyName("total_success")]
|
|
public long TotalSuccess { get; set; }
|
|
|
|
[JsonPropertyName("total_open")]
|
|
public long TotalOpen { get; set; }
|
|
|
|
[JsonPropertyName("avg_ctr")]
|
|
public double AvgCtr { get; set; }
|
|
|
|
[JsonPropertyName("active_service_count")]
|
|
public int ActiveServiceCount { get; set; }
|
|
|
|
[JsonPropertyName("success_rate_change")]
|
|
public double SuccessRateChange { get; set; }
|
|
|
|
[JsonPropertyName("device_count_change")]
|
|
public int DeviceCountChange { get; set; }
|
|
|
|
[JsonPropertyName("today_sent_change_rate")]
|
|
public double TodaySentChangeRate { get; set; }
|
|
|
|
[JsonPropertyName("today")]
|
|
public PeriodStatDto Today { get; set; } = new();
|
|
|
|
[JsonPropertyName("this_month")]
|
|
public PeriodStatDto ThisMonth { get; set; } = new();
|
|
}
|
|
|
|
public class TopMessageDto
|
|
{
|
|
[JsonPropertyName("message_code")]
|
|
public string MessageCode { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("title")]
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("service_name")]
|
|
public string ServiceName { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("total_send_count")]
|
|
public int TotalSendCount { get; set; }
|
|
|
|
[JsonPropertyName("success_count")]
|
|
public int SuccessCount { get; set; }
|
|
|
|
[JsonPropertyName("status")]
|
|
public string Status { get; set; } = string.Empty;
|
|
}
|