Update BaseSrv + update in cascata servizi derivati + inizio DTO x IobList
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Core.DTO
|
||||
{
|
||||
public class IobDTO
|
||||
{
|
||||
|
||||
[Key]
|
||||
/// <summary>
|
||||
/// Idx macchina
|
||||
/// </summary>
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Cod macchina
|
||||
/// </summary>
|
||||
public string CodMacchina { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Nome macchina
|
||||
/// </summary>
|
||||
public string Nome { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Descrizione macchina
|
||||
/// </summary>
|
||||
public string Descrizione { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Descrizione macchina
|
||||
/// </summary>
|
||||
public string Note { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipo di IOB (Win / rPi / Python)
|
||||
/// </summary>
|
||||
public string OS { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome PC Iob
|
||||
/// </summary>
|
||||
public string IobName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// IP v4 PC Iob
|
||||
/// </summary>
|
||||
public string IobIpv4 { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Mac address IOB
|
||||
/// </summary>
|
||||
public string IobMac { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome Adapter
|
||||
/// </summary>
|
||||
public string AdaptName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Sottotipo Adapter
|
||||
/// </summary>
|
||||
public string AdapType { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Versione Adapter
|
||||
/// </summary>
|
||||
public string AdapVers { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// IP del target CNC/PLC
|
||||
/// </summary>
|
||||
public string TargetIp { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Porta del target CNC/PLC
|
||||
/// </summary>
|
||||
public string TargetPort { get; set; } = "";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,6 +13,36 @@ namespace MP.Data.Services
|
||||
/// </summary>
|
||||
public class BaseServ
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public BaseServ(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
redisDb = redisConn.GetDatabase();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static IConfiguration _configuration = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
protected ConnectionMultiplexer redisConn = null!;
|
||||
|
||||
//ISubscriber sub = redis.GetSubscriber();
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
protected IDatabase redisDb = null!;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -48,9 +79,6 @@ namespace MP.Data.Services
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
|
||||
protected static IConfiguration _configuration = null!;
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
@@ -63,6 +91,7 @@ namespace MP.Data.Services
|
||||
/// </summary>
|
||||
private int cacheTtlShort = 60 * 1;
|
||||
|
||||
//private string redisBaseKey = "MP:BASE:Cache";
|
||||
private Random rnd = new Random();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -18,14 +18,8 @@ namespace MP.Data.Services
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public LandDataService(IConfiguration configuration)
|
||||
public LandDataService(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
redisDb = redisConn.GetDatabase();
|
||||
|
||||
// conf DB
|
||||
string connStr = _configuration.GetConnectionString("MP.Land");
|
||||
if (string.IsNullOrEmpty(connStr))
|
||||
@@ -125,24 +119,9 @@ namespace MP.Data.Services
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
protected ConnectionMultiplexer redisConn = null!;
|
||||
|
||||
//ISubscriber sub = redis.GetSubscriber();
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
protected IDatabase redisDb = null!;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private string redisBaseKey = "MP:LAND:Cache";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace MP.Data.Services
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public ListSelectDataSrv(IConfiguration configuration)
|
||||
public ListSelectDataSrv(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
// setup compoenti REDIS
|
||||
|
||||
@@ -22,13 +22,15 @@ namespace MP.Data.Services
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public OrderDataSrv(IConfiguration configuration)
|
||||
public OrderDataSrv(IConfiguration configuration): base(configuration)
|
||||
{
|
||||
#if false
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
redisDb = redisConn.GetDatabase();
|
||||
redisDb = redisConn.GetDatabase();
|
||||
#endif
|
||||
|
||||
// conf DB
|
||||
string connStr = _configuration.GetConnectionString("MP.All");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MP.Data.DbModels;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DbModels;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System.Collections.Generic;
|
||||
@@ -8,6 +9,14 @@ namespace MP.Data.Services
|
||||
{
|
||||
public class SharedMemService : BaseServ
|
||||
{
|
||||
/// <summary>
|
||||
/// Init servizio TAB
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
public SharedMemService(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
}
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace MP.Data.Services
|
||||
/// Init servizio TAB
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
public TabDataService(IConfiguration configuration)
|
||||
public TabDataService(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace MP.Data.Services
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public TranslateSrv(IConfiguration configuration)
|
||||
public TranslateSrv(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.16.2506.3020</Version>
|
||||
<Version>6.16.2507.0108</Version>
|
||||
<Configurations>Debug;Release;Debug_LiManDebug</Configurations>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo Tablet MAPO - DotNet6</i>
|
||||
<h4>Versione: 6.16.2506.3020</h4>
|
||||
<h4>Versione: 6.16.2507.0108</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2506.3020
|
||||
6.16.2507.0108
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2506.3020</version>
|
||||
<version>6.16.2507.0108</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user