diff --git a/GPW.CORE.Api/Controllers/CheckProj.cs b/GPW.CORE.Api/Controllers/CheckProj.cs new file mode 100644 index 0000000..745563c --- /dev/null +++ b/GPW.CORE.Api/Controllers/CheckProj.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace GPW.CORE.Api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class CheckProj : ControllerBase + { + + private readonly ILogger _logger; + + public CheckProj(ILogger logger) + { + _logger = logger; + } + + [HttpGet("TryLock")] + public async Task Get() + { + string answ = "ND"; + // provo ad eseguire... + + await Task.Delay(100); + + return answ; + } + } +} diff --git a/GPW.CORE.Api/Controllers/CheckTimbrature.cs b/GPW.CORE.Api/Controllers/CheckTimbrature.cs new file mode 100644 index 0000000..8d6c480 --- /dev/null +++ b/GPW.CORE.Api/Controllers/CheckTimbrature.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace GPW.CORE.Api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class CheckTimbrature : ControllerBase + { + } +} diff --git a/GPW.CORE.Api/Controllers/WeatherForecastController.cs b/GPW.CORE.Api/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..d74d05c --- /dev/null +++ b/GPW.CORE.Api/Controllers/WeatherForecastController.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Mvc; + +namespace GPW.CORE.Api.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateTime.Now.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/GPW.CORE.Api/Data/ApiDataService.cs b/GPW.CORE.Api/Data/ApiDataService.cs new file mode 100644 index 0000000..ac39d15 --- /dev/null +++ b/GPW.CORE.Api/Data/ApiDataService.cs @@ -0,0 +1,57 @@ +using NLog; + +namespace GPW.CORE.Api.Data +{ + public class ApiDataService + { + private static IConfiguration _configuration; + + private static ILogger _logger; + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + private readonly IEmailSender _emailSender; + + //private readonly IDistributedCache distributedCache; + private readonly IRedisCacheClient _redisCacheClient; + /// + /// TTL da 1 min x cache Redis + /// + protected const int shortTTL = 60 * 5; + + + /// + /// Classe Accesso metodi DB + /// + public static LiMan.DB.Controllers.DbController dbController; + + /// + /// Init classe + /// + /// + /// + /// + /// + public ApiDataService(IConfiguration configuration, ILogger logger, IEmailSender emailSender, IRedisCacheClient redisCacheClient) + //public ApiDataService(IConfiguration configuration, ILogger logger, IDistributedCache distributedCache, IEmailSender emailSender, IRedisCacheClient redisCacheClient) + { + _logger = logger; + _configuration = configuration; + _emailSender = emailSender; + _redisCacheClient = redisCacheClient; + //this.distributedCache = distributedCache; + + // conf DB + string connStrDB = _configuration.GetConnectionString("LiMan.DB"); + if (string.IsNullOrEmpty(connStrDB)) + { + _logger.LogError("ConnString empty!"); + } + else + { + dbController = new GPW.CORE.Data.Controllers.DbController(configuration); + _logger.LogInformation("DbController OK"); + } + } + } +} diff --git a/GPW.CORE.Api/Data/IEmailSender.cs b/GPW.CORE.Api/Data/IEmailSender.cs new file mode 100644 index 0000000..079743c --- /dev/null +++ b/GPW.CORE.Api/Data/IEmailSender.cs @@ -0,0 +1,6 @@ +namespace GPW.CORE.Api.Data +{ + public interface IEmailSender + { + } +} \ No newline at end of file diff --git a/GPW.CORE.Api/Data/IRedisCacheClient.cs b/GPW.CORE.Api/Data/IRedisCacheClient.cs new file mode 100644 index 0000000..7a9068b --- /dev/null +++ b/GPW.CORE.Api/Data/IRedisCacheClient.cs @@ -0,0 +1,6 @@ +namespace GPW.CORE.Api.Data +{ + public interface IRedisCacheClient + { + } +} \ No newline at end of file diff --git a/GPW.CORE.Api/GPW.CORE.Api.csproj b/GPW.CORE.Api/GPW.CORE.Api.csproj new file mode 100644 index 0000000..8410a64 --- /dev/null +++ b/GPW.CORE.Api/GPW.CORE.Api.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/GPW.CORE.Api/Program.cs b/GPW.CORE.Api/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/GPW.CORE.Api/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/GPW.CORE.Api/Properties/launchSettings.json b/GPW.CORE.Api/Properties/launchSettings.json new file mode 100644 index 0000000..9253c1e --- /dev/null +++ b/GPW.CORE.Api/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:39480", + "sslPort": 44359 + } + }, + "profiles": { + "GPW.CORE.Api": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7178;http://localhost:5178", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/GPW.CORE.Api/WeatherForecast.cs b/GPW.CORE.Api/WeatherForecast.cs new file mode 100644 index 0000000..75a2c24 --- /dev/null +++ b/GPW.CORE.Api/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace GPW.CORE.Api +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} \ No newline at end of file diff --git a/GPW.CORE.Api/appsettings.Development.json b/GPW.CORE.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/GPW.CORE.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/GPW.CORE.Api/appsettings.json b/GPW.CORE.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/GPW.CORE.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/GPW.CORE.UI.sln b/GPW.CORE.UI.sln index e963b3c..2bad4bf 100644 --- a/GPW.CORE.UI.sln +++ b/GPW.CORE.UI.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GPW.CORE.UI", "GPW.CORE.UI\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GPW.CORE.Data", "GPW.CORE.Data\GPW.CORE.Data.csproj", "{718B275D-7573-4CE2-87AF-57FCAAD71BD8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPW.CORE.Api", "GPW.CORE.Api\GPW.CORE.Api.csproj", "{5204CC6B-88E2-4EFB-9DC8-2C74F32991D0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {718B275D-7573-4CE2-87AF-57FCAAD71BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU {718B275D-7573-4CE2-87AF-57FCAAD71BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU {718B275D-7573-4CE2-87AF-57FCAAD71BD8}.Release|Any CPU.Build.0 = Release|Any CPU + {5204CC6B-88E2-4EFB-9DC8-2C74F32991D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5204CC6B-88E2-4EFB-9DC8-2C74F32991D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5204CC6B-88E2-4EFB-9DC8-2C74F32991D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5204CC6B-88E2-4EFB-9DC8-2C74F32991D0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index f6346ab..04bd9b3 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 3.0.2201.2414

+

Versione: 3.0.2201.2510


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 38b2cbf..b042bfe 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -3.0.2201.2414 +3.0.2201.2510 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 3a8d2ed..116b359 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 3.0.2201.2414 + 3.0.2201.2510 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false