Добавьте файлы проекта.
This commit is contained in:
63
SQLVision.Core/Models/ScriptMetadata.cs
Normal file
63
SQLVision.Core/Models/ScriptMetadata.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using SQLVision.Core.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SQLVision.Core.Models;
|
||||
|
||||
public class ScriptMetadata
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
[JsonPropertyName("fileName")]
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("fullPath")]
|
||||
public string FullPath { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[JsonPropertyName("rawSql")]
|
||||
public string RawSql { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("processedSql")]
|
||||
public string ProcessedSql { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("connectionString")]
|
||||
public string? ConnectionString { get; set; }
|
||||
|
||||
[JsonPropertyName("databaseProvider")]
|
||||
public DatabaseProvider DatabaseProvider { get; set; } = DatabaseProvider.SqlServer;
|
||||
|
||||
[JsonPropertyName("parameters")]
|
||||
public List<ScriptParameter> Parameters { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("outputs")]
|
||||
public List<OutputDefinition> Outputs { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("metadata")]
|
||||
public Dictionary<string, object> Metadata { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("lastModified")]
|
||||
public DateTime LastModified { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[JsonPropertyName("category")]
|
||||
public string? Category { get; set; }
|
||||
|
||||
[JsonPropertyName("tags")]
|
||||
public List<string> Tags { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("executionCount")]
|
||||
public int ExecutionCount { get; set; }
|
||||
|
||||
[JsonPropertyName("averageExecutionTime")]
|
||||
public TimeSpan AverageExecutionTime { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string DisplayName => !string.IsNullOrEmpty(Description)
|
||||
? Description
|
||||
: Path.GetFileNameWithoutExtension(FileName);
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsVisible { get; set; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user