Adding
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
namespace LCU.Api.Internal.FTP.Configuration;
|
||||
|
||||
public class EnvironmentView : IEnvironmentView
|
||||
{
|
||||
public string Application => _env.ApplicationName;
|
||||
public DateTime CurrentDate => DateTime.Now;
|
||||
public string BuildVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
public DateTime BuildDate => AssemblyBuildDate();
|
||||
public string Environment => _env.EnvironmentName;
|
||||
private readonly IWebHostEnvironment _env;
|
||||
|
||||
public EnvironmentView(IWebHostEnvironment env)
|
||||
{
|
||||
_env = env;
|
||||
}
|
||||
|
||||
public static DateTime AssemblyBuildDate()
|
||||
{
|
||||
//https://stackoverflow.com/a/804310/266594
|
||||
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
System.IO.FileInfo fileInfo = new System.IO.FileInfo(assembly.Location);
|
||||
DateTime lastModified = fileInfo.LastWriteTime;
|
||||
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace LCU.Api.Internal.FTP.Configuration;
|
||||
|
||||
public class FtpApiConfiguration
|
||||
{
|
||||
public int AttemptsLimit { get; set; }
|
||||
public Apis Apis { get; set; }
|
||||
}
|
||||
|
||||
public class Apis
|
||||
{
|
||||
public FileOperationApi FileOperationApi { get; set; }
|
||||
}
|
||||
public class FileOperationApi
|
||||
{
|
||||
public string BuildDynamicFileRequest { get; set; }
|
||||
public string ValidateFileExists { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
namespace LCU.Api.Internal.FTP.Configuration;
|
||||
|
||||
public interface IEnvironmentView
|
||||
{
|
||||
string Application { get; }
|
||||
DateTime CurrentDate { get; }
|
||||
string BuildVersion { get; }
|
||||
DateTime BuildDate { get; }
|
||||
string Environment { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user