- ErrorCodes.ServiceScopeRequired("133") 추가
- SpmsException.Forbidden 팩토리 추가
- ServiceCodeMiddleware 3-카테고리 라우팅 (SKIP/REQUIRED/OPTIONAL_FOR_ADMIN)
- Swagger 필터 stats/device-list X-Service-Code optional 표시
- StatsController/DeviceController GetOptionalServiceId() 적용
- IStatsService/IDeviceService/레포지토리 시그니처 long? serviceId 변경
- StatsService/DeviceService null serviceId 전체 서비스 모드 처리
Closes #199
56 lines
2.0 KiB
C#
56 lines
2.0 KiB
C#
using SPMS.Domain.Entities;
|
|
using SPMS.Domain.Enums;
|
|
|
|
namespace SPMS.Domain.Interfaces;
|
|
|
|
public interface IPushSendLogRepository : IRepository<PushSendLog>
|
|
{
|
|
Task<(IReadOnlyList<PushSendLog> Items, int TotalCount)> GetPagedWithMessageAsync(
|
|
long serviceId, int page, int size,
|
|
long? messageId = null, long? deviceId = null,
|
|
PushResult? status = null,
|
|
DateTime? startDate = null, DateTime? endDate = null);
|
|
|
|
Task<List<HourlyStatRaw>> GetHourlyStatsAsync(long? serviceId, DateTime startDate, DateTime endDate);
|
|
Task<MessageStatRaw?> GetMessageStatsAsync(long serviceId, long messageId, DateTime? startDate, DateTime? endDate);
|
|
Task<List<MessageDailyStatRaw>> GetMessageDailyStatsAsync(long serviceId, long messageId, DateTime? startDate, DateTime? endDate);
|
|
Task<(IReadOnlyList<PushSendLog> Items, int TotalCount)> GetDetailLogPagedAsync(
|
|
long serviceId, long messageId, int page, int size,
|
|
PushResult? status = null, Platform? platform = null);
|
|
Task<IReadOnlyList<PushSendLog>> GetExportLogsAsync(
|
|
long serviceId, DateTime startDate, DateTime endDate,
|
|
long? messageId = null, long? deviceId = null,
|
|
PushResult? status = null, int maxCount = 100000);
|
|
Task<List<FailureStatRaw>> GetFailureStatsAsync(long? serviceId, DateTime startDate, DateTime endDate, int limit);
|
|
}
|
|
|
|
public class HourlyStatRaw
|
|
{
|
|
public int Hour { get; set; }
|
|
public int SendCount { get; set; }
|
|
public int SuccessCount { get; set; }
|
|
public int FailCount { get; set; }
|
|
}
|
|
|
|
public class MessageStatRaw
|
|
{
|
|
public int TotalSend { get; set; }
|
|
public int TotalSuccess { get; set; }
|
|
public int TotalFail { get; set; }
|
|
public DateTime? FirstSentAt { get; set; }
|
|
public DateTime? LastSentAt { get; set; }
|
|
}
|
|
|
|
public class MessageDailyStatRaw
|
|
{
|
|
public DateOnly StatDate { get; set; }
|
|
public int SendCount { get; set; }
|
|
public int SuccessCount { get; set; }
|
|
}
|
|
|
|
public class FailureStatRaw
|
|
{
|
|
public string FailReason { get; set; } = string.Empty;
|
|
public int Count { get; set; }
|
|
}
|