Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
namespace RobotNet10.CustomConfiguration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Model đại diện cho một file config
|
||||
/// ConfigType là tên định danh duy nhất (ví dụ: MQTTBrokerConfig)
|
||||
/// </summary>
|
||||
public class ConfigFile
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string ConfigType { get; set; } = string.Empty; // Tên định danh duy nhất (ví dụ: MQTTBrokerConfig)
|
||||
public string FilePath { get; set; } = string.Empty; // Path trong StorageManager
|
||||
public List<ConfigVariable> Variables { get; set; } = [];
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace RobotNet10.CustomConfiguration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Metadata của config file (không bao gồm nội dung variables)
|
||||
/// </summary>
|
||||
public class ConfigFileMetadata
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string ConfigType { get; set; } = string.Empty; // Tên định danh duy nhất
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace RobotNet10.CustomConfiguration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Model đại diện cho một variable trong config
|
||||
/// </summary>
|
||||
public class ConfigVariable
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public ConfigVariableType Type { get; set; }
|
||||
public object? Value { get; set; }
|
||||
|
||||
// Optional properties
|
||||
public double? Min { get; set; } // Cho int và double
|
||||
public double? Max { get; set; } // Cho int và double
|
||||
public string Roles { get; set; } = string.Empty; // Roles string (có thể empty)
|
||||
public List<string>? EnumValues { get; set; } // Cho type Enum - danh sách các giá trị cho phép
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace RobotNet10.CustomConfiguration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Enum định nghĩa các loại variable type được hỗ trợ
|
||||
/// </summary>
|
||||
public enum ConfigVariableType
|
||||
{
|
||||
String,
|
||||
Int,
|
||||
Double,
|
||||
Bool,
|
||||
Object, // JSON object (Dictionary<string, object>)
|
||||
Array, // JSON array (List<object>)
|
||||
Enum // Enum với các giá trị được định nghĩa trong EnumValues
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user