diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/ConnectedService.json b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/ConnectedService.json index 5ca9aa6..3854835 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/ConnectedService.json +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/ConnectedService.json @@ -14,7 +14,7 @@ "GenerateTypeScriptClient": false, "GenerateCSharpController": false, "OpenApiToCSharpClientCommand": { - "ClientBaseClass": null, + "ClientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase", "ConfigurationClass": null, "GenerateClientClasses": true, "GenerateClientInterfaces": false, @@ -27,7 +27,7 @@ "WrapDtoExceptions": true, "UseHttpClientCreationMethod": false, "HttpClientType": "System.Net.Http.HttpClient", - "UseHttpRequestMessageCreationMethod": false, + "UseHttpRequestMessageCreationMethod": true, "UseBaseUrl": true, "GenerateBaseUrlProperty": true, "GenerateSyncMethods": false, @@ -61,10 +61,10 @@ "ResponseClass": "SwaggerResponse", "Namespace": "Identity.GeneratedServices", "RequiredPropertiesMustBeDefined": true, - "DateType": "System.DateTimeOffset", + "DateType": "System.DateTime", "JsonConverters": [], "AnyType": "object", - "DateTimeType": "System.DateTimeOffset", + "DateTimeType": "System.DateTime", "TimeType": "System.TimeSpan", "TimeSpanType": "System.TimeSpan", "ArrayType": "System.Collections.Generic.ICollection", diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.cs b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.cs index 20c11aa..93d8cd7 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.cs +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.cs @@ -19,13 +19,13 @@ namespace Identity.GeneratedServices using System = global::System; [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class IdentityClient + public partial class AuthenticationClient : EasyMicroservices.Cores.Clients.CoreSwaggerClientBase { private string _baseUrl = ""; private System.Net.Http.HttpClient _httpClient; private System.Lazy _settings; - public IdentityClient(string baseUrl, System.Net.Http.HttpClient httpClient) + public AuthenticationClient(string baseUrl, System.Net.Http.HttpClient httpClient) { BaseUrl = baseUrl; _httpClient = httpClient; @@ -66,13 +66,13 @@ public virtual System.Threading.Tasks.Task VerifyUserNameAsync( public virtual async System.Threading.Tasks.Task VerifyUserNameAsync(VerifyUserRequestContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/VerifyUserName"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/VerifyUserName"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -144,13 +144,13 @@ public virtual System.Threading.Tasks.Task RegisterAsync(AddUserRequestContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/Register"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/Register"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -222,13 +222,13 @@ public virtual System.Threading.Tasks.Task LoginAsync(UserSummaryContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/Login"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/Login"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -300,13 +300,13 @@ public virtual System.Threading.Tasks.Task public virtual async System.Threading.Tasks.Task GenerateTokenAsync(UserClaimContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/GenerateToken"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/GenerateToken"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -378,13 +378,13 @@ public virtual System.Threading.Tasks.Task public virtual async System.Threading.Tasks.Task RegenerateTokenAsync(RegenerateTokenContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/RegenerateToken"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/RegenerateToken"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -456,13 +456,13 @@ public virtual System.Threading.Tasks.Task ApplicationInitializeAsync(ApplicationInitializeRequestContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/ApplicationInitialize"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/ApplicationInitialize"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); @@ -534,13 +534,13 @@ public virtual System.Threading.Tasks.Task public virtual async System.Threading.Tasks.Task LoginByPersonalAccessTokenAsync(LoginByPersonalAccessTokenRequestContract body, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Identity/LoginByPersonalAccessToken"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Authentication/LoginByPersonalAccessToken"); var client_ = _httpClient; var disposeClient_ = false; try { - using (var request_ = new System.Net.Http.HttpRequestMessage()) + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag index 37dbe2c..8144db8 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag @@ -10,7 +10,7 @@ }, "codeGenerators": { "openApiToCSharpClient": { - "clientBaseClass": null, + "clientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase", "configurationClass": null, "generateClientClasses": true, "generateClientInterfaces": false, @@ -23,7 +23,7 @@ "wrapDtoExceptions": true, "useHttpClientCreationMethod": false, "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, + "useHttpRequestMessageCreationMethod": true, "useBaseUrl": true, "generateBaseUrlProperty": true, "generateSyncMethods": false, @@ -57,10 +57,10 @@ "responseClass": "SwaggerResponse", "namespace": "Identity.GeneratedServices", "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", + "dateType": "System.DateTime", "jsonConverters": [], "anyType": "object", - "dateTimeType": "System.DateTimeOffset", + "dateTimeType": "System.DateTime", "timeType": "System.TimeSpan", "timeSpanType": "System.TimeSpan", "arrayType": "System.Collections.Generic.ICollection", diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag.json b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag.json index 8b1d3e3..47001e0 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag.json +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag.json @@ -5,10 +5,10 @@ "version": "1.0" }, "paths": { - "/api/Identity/VerifyUserName": { + "/api/Authentication/VerifyUserName": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "VerifyUserName", "requestBody": { @@ -54,10 +54,10 @@ } } }, - "/api/Identity/Register": { + "/api/Authentication/Register": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "Register", "requestBody": { @@ -103,10 +103,10 @@ } } }, - "/api/Identity/Login": { + "/api/Authentication/Login": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "Login", "requestBody": { @@ -152,10 +152,10 @@ } } }, - "/api/Identity/GenerateToken": { + "/api/Authentication/GenerateToken": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "GenerateToken", "requestBody": { @@ -201,10 +201,10 @@ } } }, - "/api/Identity/RegenerateToken": { + "/api/Authentication/RegenerateToken": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "RegenerateToken", "requestBody": { @@ -250,10 +250,10 @@ } } }, - "/api/Identity/ApplicationInitialize": { + "/api/Authentication/ApplicationInitialize": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "ApplicationInitialize", "requestBody": { @@ -299,10 +299,10 @@ } } }, - "/api/Identity/LoginByPersonalAccessToken": { + "/api/Authentication/LoginByPersonalAccessToken": { "post": { "tags": [ - "Identity" + "Authentication" ], "operationId": "LoginByPersonalAccessToken", "requestBody": { diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/EasyMicroservices.IdentityMicroservice.Clients.csproj b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/EasyMicroservices.IdentityMicroservice.Clients.csproj index d71d2a4..e2f9639 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/EasyMicroservices.IdentityMicroservice.Clients.csproj +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.Clients/EasyMicroservices.IdentityMicroservice.Clients.csproj @@ -16,11 +16,11 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/IdentityController.cs b/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs similarity index 98% rename from src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/IdentityController.cs rename to src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs index 63c5078..9a358cf 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/IdentityController.cs +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs @@ -18,7 +18,7 @@ namespace EasyMicroservices.IdentityMicroservice.WebApi.Controllers [ApiController] [Route("api/[controller]/[action]")] [AllowAnonymous] - public class IdentityController : ControllerBase + public class AuthenticationController : ControllerBase { private readonly IJWTManager _jwtManager; private readonly IdentityHelper _identityHelper; @@ -26,7 +26,7 @@ public class IdentityController : ControllerBase private readonly ClaimManager _claimManager; private readonly string _authRoot; - public IdentityController(IAppUnitOfWork appUnitOfWork) + public AuthenticationController(IAppUnitOfWork appUnitOfWork) { _appUnitOfWork = appUnitOfWork; _identityHelper = _appUnitOfWork.GetIdentityHelper(); diff --git a/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/EasyMicroservices.IdentityMicroservice.WebApi.csproj b/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/EasyMicroservices.IdentityMicroservice.WebApi.csproj index c3bdf0a..731ab30 100644 --- a/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/EasyMicroservices.IdentityMicroservice.WebApi.csproj +++ b/src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/EasyMicroservices.IdentityMicroservice.WebApi.csproj @@ -17,8 +17,4 @@ - - - -