Skip to content

Commit

Permalink
Merge pull request #8 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
update client
  • Loading branch information
Ali-YousefiTelori authored Dec 2, 2023
2 parents 8485685 + 01fadbe commit 0d4f14a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"GenerateTypeScriptClient": false,
"GenerateCSharpController": false,
"OpenApiToCSharpClientCommand": {
"ClientBaseClass": null,
"ClientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase",
"ConfigurationClass": null,
"GenerateClientClasses": true,
"GenerateClientInterfaces": false,
Expand All @@ -27,7 +27,7 @@
"WrapDtoExceptions": true,
"UseHttpClientCreationMethod": false,
"HttpClientType": "System.Net.Http.HttpClient",
"UseHttpRequestMessageCreationMethod": false,
"UseHttpRequestMessageCreationMethod": true,
"UseBaseUrl": true,
"GenerateBaseUrlProperty": true,
"GenerateSyncMethods": false,
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Newtonsoft.Json.JsonSerializerSettings> _settings;

public IdentityClient(string baseUrl, System.Net.Http.HttpClient httpClient)
public AuthenticationClient(string baseUrl, System.Net.Http.HttpClient httpClient)
{
BaseUrl = baseUrl;
_httpClient = httpClient;
Expand Down Expand Up @@ -66,13 +66,13 @@ public virtual System.Threading.Tasks.Task<MessageContract> VerifyUserNameAsync(
public virtual async System.Threading.Tasks.Task<MessageContract> 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_);
Expand Down Expand Up @@ -144,13 +144,13 @@ public virtual System.Threading.Tasks.Task<RegisterResponseContractMessageContra
public virtual async System.Threading.Tasks.Task<RegisterResponseContractMessageContract> 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_);
Expand Down Expand Up @@ -222,13 +222,13 @@ public virtual System.Threading.Tasks.Task<LoginWithTokenResponseContractMessage
public virtual async System.Threading.Tasks.Task<LoginWithTokenResponseContractMessageContract> 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_);
Expand Down Expand Up @@ -300,13 +300,13 @@ public virtual System.Threading.Tasks.Task<UserResponseContractMessageContract>
public virtual async System.Threading.Tasks.Task<UserResponseContractMessageContract> 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_);
Expand Down Expand Up @@ -378,13 +378,13 @@ public virtual System.Threading.Tasks.Task<UserResponseContractMessageContract>
public virtual async System.Threading.Tasks.Task<UserResponseContractMessageContract> 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_);
Expand Down Expand Up @@ -456,13 +456,13 @@ public virtual System.Threading.Tasks.Task<ApplicationInitializeResponseContract
public virtual async System.Threading.Tasks.Task<ApplicationInitializeResponseContractMessageContract> 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_);
Expand Down Expand Up @@ -534,13 +534,13 @@ public virtual System.Threading.Tasks.Task<UserResponseContractMessageContract>
public virtual async System.Threading.Tasks.Task<UserResponseContractMessageContract> 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_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"codeGenerators": {
"openApiToCSharpClient": {
"clientBaseClass": null,
"clientBaseClass": "EasyMicroservices.Cores.Clients.CoreSwaggerClientBase",
"configurationClass": null,
"generateClientClasses": true,
"generateClientInterfaces": false,
Expand All @@ -23,7 +23,7 @@
"wrapDtoExceptions": true,
"useHttpClientCreationMethod": false,
"httpClientType": "System.Net.Http.HttpClient",
"useHttpRequestMessageCreationMethod": false,
"useHttpRequestMessageCreationMethod": true,
"useBaseUrl": true,
"generateBaseUrlProperty": true,
"generateSyncMethods": false,
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "1.0"
},
"paths": {
"/api/Identity/VerifyUserName": {
"/api/Authentication/VerifyUserName": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "VerifyUserName",
"requestBody": {
Expand Down Expand Up @@ -54,10 +54,10 @@
}
}
},
"/api/Identity/Register": {
"/api/Authentication/Register": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "Register",
"requestBody": {
Expand Down Expand Up @@ -103,10 +103,10 @@
}
}
},
"/api/Identity/Login": {
"/api/Authentication/Login": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "Login",
"requestBody": {
Expand Down Expand Up @@ -152,10 +152,10 @@
}
}
},
"/api/Identity/GenerateToken": {
"/api/Authentication/GenerateToken": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "GenerateToken",
"requestBody": {
Expand Down Expand Up @@ -201,10 +201,10 @@
}
}
},
"/api/Identity/RegenerateToken": {
"/api/Authentication/RegenerateToken": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "RegenerateToken",
"requestBody": {
Expand Down Expand Up @@ -250,10 +250,10 @@
}
}
},
"/api/Identity/ApplicationInitialize": {
"/api/Authentication/ApplicationInitialize": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "ApplicationInitialize",
"requestBody": {
Expand Down Expand Up @@ -299,10 +299,10 @@
}
}
},
"/api/Identity/LoginByPersonalAccessToken": {
"/api/Authentication/LoginByPersonalAccessToken": {
"post": {
"tags": [
"Identity"
"Authentication"
],
"operationId": "LoginByPersonalAccessToken",
"requestBody": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Cores.Clients" Version="0.0.0.58" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="7.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.18.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ 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;
private readonly IAppUnitOfWork _appUnitOfWork;
private readonly ClaimManager _claimManager;
private readonly string _authRoot;

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

Check warning on line 27 in src/CSharp/EasyMicroservices.IdentityMicroservice.WebApi/Controllers/AuthenticationController.cs

View workflow job for this annotation

GitHub Actions / os-tests

The field 'AuthenticationController._authRoot' is never used

public IdentityController(IAppUnitOfWork appUnitOfWork)
public AuthenticationController(IAppUnitOfWork appUnitOfWork)
{
_appUnitOfWork = appUnitOfWork;
_identityHelper = _appUnitOfWork.GetIdentityHelper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@
<ProjectReference Include="..\EasyMicroservices.IdentityMicroservice.StartUp\EasyMicroservices.IdentityMicroservice.StartUp.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>

</Project>

0 comments on commit 0d4f14a

Please sign in to comment.