diff --git a/App/App.csproj b/App/App.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/App/App.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/App/Program.cs b/App/Program.cs new file mode 100644 index 0000000..6949f03 --- /dev/null +++ b/App/Program.cs @@ -0,0 +1,10 @@ +namespace App +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + } + } +} diff --git a/PI_Assync_SCDE.csproj b/App_old.csproj similarity index 100% rename from PI_Assync_SCDE.csproj rename to App_old.csproj diff --git a/Data/AccessRepository.cs b/Data/AccessRepository.cs new file mode 100644 index 0000000..fe82719 --- /dev/null +++ b/Data/AccessRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Data +{ + internal class AccessRepository + { + } +} diff --git a/Data/Data.csproj b/Data/Data.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/Data/Data.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/Data/PostgresRepository.cs b/Data/PostgresRepository.cs new file mode 100644 index 0000000..9019556 --- /dev/null +++ b/Data/PostgresRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Data +{ + internal class PostgresRepository + { + } +} diff --git a/Domain/Domain.csproj b/Domain/Domain.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/Domain/Domain.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/Domain/Medicao.cs b/Domain/Medicao.cs new file mode 100644 index 0000000..03b1133 --- /dev/null +++ b/Domain/Medicao.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Domain +{ + internal class Medicao + { + } +} diff --git a/Domain/Perfil.cs b/Domain/Perfil.cs new file mode 100644 index 0000000..9400048 --- /dev/null +++ b/Domain/Perfil.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Domain +{ + internal class Perfil + { + } +} diff --git a/Infrastructure/Infra.csproj b/Infrastructure/Infra.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/Infrastructure/Infra.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/Infrastructure/RateLimiter.cs b/Infrastructure/RateLimiter.cs new file mode 100644 index 0000000..9be40d3 --- /dev/null +++ b/Infrastructure/RateLimiter.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Infra +{ + public class RateLimiter + { + private readonly int _maxRequests; + private readonly TimeSpan _interval; + private int _requestCount; + private DateTime _windowStart; + private readonly object _lock = new(); + + public RateLimiter(int maxRequests, TimeSpan interval) + { + _maxRequests = maxRequests; + _interval = interval; + var now = DateTime.Now; + _windowStart = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute - (now.Minute % interval.Minutes), 0); + _requestCount = 0; + } + + public async Task WaitAsync(CancellationToken ct) + { + while (true) + { + lock (_lock) + { + if ((DateTime.Now - _windowStart) > _interval) + { + // reset janela + _windowStart = DateTime.Now; + _requestCount = 0; + } + + if (_requestCount < _maxRequests) + { + _requestCount++; + return; // pode prosseguir + } + } + + // já bateu o limite → espera até reset + await Task.Delay(200, ct); // aguarda 200ms e tenta de novo + } + } + } +} diff --git a/Infrastructure/SoapFaultException.cs b/Infrastructure/SoapFaultException.cs new file mode 100644 index 0000000..51b0997 --- /dev/null +++ b/Infrastructure/SoapFaultException.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Infra +{ + internal class SoapFaultException + { + } +} diff --git a/Infrastructure/SoapHelper.cs b/Infrastructure/SoapHelper.cs new file mode 100644 index 0000000..3e03f17 --- /dev/null +++ b/Infrastructure/SoapHelper.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Infra +{ + internal class SoapHelper + { + } +} diff --git a/PI_Assync_SCDE.sln b/PI_Assync_SCDE.sln index 7d70bb6..9505a85 100644 --- a/PI_Assync_SCDE.sln +++ b/PI_Assync_SCDE.sln @@ -3,7 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32319.34 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PI_Assync_SCDE", "PI_Assync_SCDE.csproj", "{48DFCC70-0352-4394-9821-2B243EB389AB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App_old", "App_old.csproj", "{48DFCC70-0352-4394-9821-2B243EB389AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infra", "Infrastructure\Infra.csproj", "{0910ED06-C154-41FF-B556-ADBA53A10427}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data", "Data\Data.csproj", "{4B7EE8CE-E452-4B31-9B21-64113B6C48C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Domain\Domain.csproj", "{38CE64C7-8F03-4622-8DD5-5BA19F66E7AF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services", "Services\Services.csproj", "{2B2323E4-C409-4432-AA45-54C1642FDA88}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{2B43C133-911B-4F3D-9DAB-1DA342D3822B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +25,26 @@ Global {48DFCC70-0352-4394-9821-2B243EB389AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {48DFCC70-0352-4394-9821-2B243EB389AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {48DFCC70-0352-4394-9821-2B243EB389AB}.Release|Any CPU.Build.0 = Release|Any CPU + {0910ED06-C154-41FF-B556-ADBA53A10427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0910ED06-C154-41FF-B556-ADBA53A10427}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0910ED06-C154-41FF-B556-ADBA53A10427}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0910ED06-C154-41FF-B556-ADBA53A10427}.Release|Any CPU.Build.0 = Release|Any CPU + {4B7EE8CE-E452-4B31-9B21-64113B6C48C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B7EE8CE-E452-4B31-9B21-64113B6C48C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B7EE8CE-E452-4B31-9B21-64113B6C48C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B7EE8CE-E452-4B31-9B21-64113B6C48C8}.Release|Any CPU.Build.0 = Release|Any CPU + {38CE64C7-8F03-4622-8DD5-5BA19F66E7AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38CE64C7-8F03-4622-8DD5-5BA19F66E7AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38CE64C7-8F03-4622-8DD5-5BA19F66E7AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38CE64C7-8F03-4622-8DD5-5BA19F66E7AF}.Release|Any CPU.Build.0 = Release|Any CPU + {2B2323E4-C409-4432-AA45-54C1642FDA88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B2323E4-C409-4432-AA45-54C1642FDA88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B2323E4-C409-4432-AA45-54C1642FDA88}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B2323E4-C409-4432-AA45-54C1642FDA88}.Release|Any CPU.Build.0 = Release|Any CPU + {2B43C133-911B-4F3D-9DAB-1DA342D3822B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B43C133-911B-4F3D-9DAB-1DA342D3822B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B43C133-911B-4F3D-9DAB-1DA342D3822B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B43C133-911B-4F3D-9DAB-1DA342D3822B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Program.cs b/Program.cs index 3102c51..0b9da98 100644 --- a/Program.cs +++ b/Program.cs @@ -419,49 +419,6 @@ internal class Plat_integ throw new SoapFaultException(faultCode, faultString, errorCode, message); } } - - public class RateLimiter - { - private readonly int _maxRequests; - private readonly TimeSpan _interval; - private int _requestCount; - private DateTime _windowStart; - private readonly object _lock = new(); - - public RateLimiter(int maxRequests, TimeSpan interval) - { - _maxRequests = maxRequests; - _interval = interval; - var now = DateTime.Now; - _windowStart = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute - (now.Minute % interval.Minutes), 0); - _requestCount = 0; - } - - public async Task WaitAsync(CancellationToken ct) - { - while (true) - { - lock (_lock) - { - if ((DateTime.Now - _windowStart) > _interval) - { - // reset janela - _windowStart = DateTime.Now; - _requestCount = 0; - } - - if (_requestCount < _maxRequests) - { - _requestCount++; - return; // pode prosseguir - } - } - - // já bateu o limite → espera até reset - await Task.Delay(200, ct); // aguarda 200ms e tenta de novo - } - } - } } public class perfil diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 9260528..bf8d6c1 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -1,24 +1,24 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// O código foi gerado por uma ferramenta. +// Versão de Tempo de Execução:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se +// o código for gerado novamente. // //------------------------------------------------------------------------------ -namespace PI_Assync_SCDE.Properties { +namespace App_old.Properties { using System; /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Uma classe de recurso de tipo de alta segurança, para pesquisar cadeias de caracteres localizadas etc. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. + // Essa classe foi gerada automaticamente pela classe StronglyTypedResourceBuilder + // através de uma ferramenta como ResGen ou Visual Studio. + // Para adicionar ou remover um associado, edite o arquivo .ResX e execute ResGen novamente + // com a opção /str, ou recrie o projeto do VS. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,13 +33,13 @@ namespace PI_Assync_SCDE.Properties { } /// - /// Returns the cached ResourceManager instance used by this class. + /// Retorna a instância de ResourceManager armazenada em cache usada por essa classe. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PI_Assync_SCDE.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("App_old.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -47,8 +47,8 @@ namespace PI_Assync_SCDE.Properties { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Substitui a propriedade CurrentUICulture do thread atual para todas as + /// pesquisas de recursos que usam essa classe de recurso de tipo de alta segurança. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/Services/MedicaoService.cs b/Services/MedicaoService.cs new file mode 100644 index 0000000..4a0c013 --- /dev/null +++ b/Services/MedicaoService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Services +{ + internal class MedicaoService + { + } +} diff --git a/Services/Services.csproj b/Services/Services.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/Services/Services.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/Services/SoapService.cs b/Services/SoapService.cs new file mode 100644 index 0000000..5e63ae0 --- /dev/null +++ b/Services/SoapService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Services +{ + internal class SoapService + { + } +}