You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.6 KiB
C#

using System;
using System.Collections.Generic;
using Haoliang.Models.Device;
namespace Haoliang.Models.DataCollection
{
public class CollectionTask
{
public int Id { get; set; }
public int DeviceId { get; set; }
public string TaskName { get; set; }
public string Status { get; set; } // Pending, Running, Completed, Failed
public DateTime ScheduledTime { get; set; }
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
public bool IsSuccess { get; set; }
public string ErrorMessage { get; set; }
public int RetryCount { get; set; }
public DateTime CreatedAt { get; set; }
}
public class CollectionResult
{
public int Id { get; set; }
public int DeviceId { get; set; }
public int TaskId { get; set; }
public DateTime CollectionTime { get; set; }
public string RawJson { get; set; }
public bool IsSuccess { get; set; }
public string ErrorMessage { get; set; }
public int RetryCount { get; set; }
public DateTime CreatedAt { get; set; }
public DeviceCurrentStatus ParsedData { get; set; }
}
public class CollectionLog
{
public int Id { get; set; }
public int DeviceId { get; set; }
public LogLevel LogLevel { get; set; }
public string LogCategory { get; set; }
public string LogMessage { get; set; }
public string LogData { get; set; }
public string SourceMethod { get; set; }
public string SourceFile { get; set; }
public DateTime LogTime { get; set; }
public DateTime CreatedAt { get; set; }
}
public enum LogLevel
{
Debug = 0,
Information = 1,
Warning = 2,
Error = 3,
Critical = 4
}
public class CollectionStatistics
{
public DateTime Date { get; set; }
public int TotalAttempts { get; set; }
public int SuccessCount { get; set; }
public int FailedCount { get; set; }
public decimal SuccessRate { get; set; }
public TimeSpan AverageResponseTime { get; set; }
public int DeviceCount { get; set; }
public int OnlineDeviceCount { get; set; }
public long TotalDataSize { get; set; }
}
public class CollectionConfig
{
public int Id { get; set; }
public string ConfigKey { get; set; }
public string ConfigValue { get; set; }
public string Description { get; set; }
public bool IsEnabled { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
public class CollectionHealth
{
public DateTime CheckTime { get; set; }
public int TotalDevices { get; set; }
public int OnlineDevices { get; set; }
public int ActiveCollectionTasks { get; set; }
public int FailedTasks { get; set; }
public double SuccessRate { get; set; }
public double AverageResponseTime { get; set; }
public long TotalCollectedData { get; set; }
public DateTime LastSuccessfulCollection { get; set; }
public DateTime LastFailedCollection { get; set; }
}
public class CollectionFilter
{
public List<int> DeviceIds { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public bool? IsSuccess { get; set; }
public string Status { get; set; }
public int? RetryCount { get; set; }
public string SearchKeyword { get; set; }
}
}