server cleanup

This commit is contained in:
hamid
2026-06-16 01:46:53 +03:30
parent 69bbd28bb0
commit 5b4c0d183f
205 changed files with 641 additions and 628 deletions
@@ -18,9 +18,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Monitoring\CleanArc.Infrastructure.Monitoring.csproj" />
<ProjectReference Include="..\CleanArc.WebFramework\CleanArc.WebFramework.csproj" />
<ProjectReference Include="..\Plugins\CleanArc.Web.Plugins.Grpc\CleanArc.Web.Plugins.Grpc.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Monitoring\Baya.Infrastructure.Monitoring.csproj" />
<ProjectReference Include="..\Baya.WebFramework\Baya.WebFramework.csproj" />
<ProjectReference Include="..\Plugins\Baya.Web.Plugins.Grpc\Baya.Web.Plugins.Grpc.csproj" />
</ItemGroup>
</Project>
@@ -1,14 +1,14 @@
using Asp.Versioning;
using CleanArc.Application.Features.Admin.Commands.AddAdminCommand;
using CleanArc.Application.Features.Admin.Queries.GetToken;
using CleanArc.Application.Models.Jwt;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Admin.Commands.AddAdminCommand;
using Baya.Application.Features.Admin.Queries.GetToken;
using Baya.Application.Models.Jwt;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,14 +1,14 @@
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Order.Queries.GetAllOrders;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Order.Queries.GetAllOrders;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,17 +1,17 @@
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Role.Commands.AddRoleCommand;
using CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
using CleanArc.Application.Features.Role.Queries.GetAllRolesQuery;
using CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Role.Commands.AddRoleCommand;
using Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
using Baya.Application.Features.Role.Queries.GetAllRolesQuery;
using Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,14 +1,14 @@
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Users.Queries.GetUsers;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Users.Queries.GetUsers;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,13 +1,13 @@
using Asp.Versioning;
using CleanArc.Application.Features.Order.Commands;
using CleanArc.Application.Features.Order.Queries.GetUserOrders;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Order.Commands;
using Baya.Application.Features.Order.Queries.GetUserOrders;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Order;
namespace Baya.Web.Api.Controllers.V1.Order;
[ApiVersion("1")]
[ApiController]
@@ -1,20 +1,20 @@
using Asp.Versioning;
using CleanArc.Application.Features.Users.Commands.Create;
using CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand;
using CleanArc.Application.Features.Users.Commands.RequestLogout;
using CleanArc.Application.Features.Users.Queries.GenerateUserToken;
using CleanArc.Application.Features.Users.Queries.TokenRequest;
using CleanArc.Application.Models.Jwt;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using CleanArc.WebFramework.Swagger;
using Baya.Application.Features.Users.Commands.Create;
using Baya.Application.Features.Users.Commands.RefreshUserTokenCommand;
using Baya.Application.Features.Users.Commands.RequestLogout;
using Baya.Application.Features.Users.Queries.GenerateUserToken;
using Baya.Application.Features.Users.Queries.TokenRequest;
using Baya.Application.Models.Jwt;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Baya.WebFramework.Swagger;
using Mediator;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.UserManagement;
namespace Baya.Web.Api.Controllers.V1.UserManagement;
[ApiVersion("1")]
[ApiController]
@@ -1,22 +1,22 @@
using System.Diagnostics;
using CleanArc.Application.Features.Users.Commands.Create;
using CleanArc.Application.Models.ApiResult;
using CleanArc.Application.Models.Identity;
using CleanArc.Application.ServiceConfiguration;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.CrossCutting.Logging;
using CleanArc.Infrastructure.Identity.Identity.Dtos;
using CleanArc.Infrastructure.Identity.Jwt;
using CleanArc.Infrastructure.Identity.ServiceConfiguration;
using CleanArc.Infrastructure.Monitoring.Configurations;
using CleanArc.Infrastructure.Persistence.ServiceConfiguration;
using CleanArc.SharedKernel.Extensions;
using CleanArc.Web.Api.Controllers.V1.UserManagement;
using CleanArc.Web.Plugins.Grpc;
using CleanArc.WebFramework.Filters;
using CleanArc.WebFramework.Middlewares;
using CleanArc.WebFramework.ServiceConfiguration;
using CleanArc.WebFramework.Swagger;
using Baya.Application.Features.Users.Commands.Create;
using Baya.Application.Models.ApiResult;
using Baya.Application.Models.Identity;
using Baya.Application.ServiceConfiguration;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.CrossCutting.Logging;
using Baya.Infrastructure.Identity.Identity.Dtos;
using Baya.Infrastructure.Identity.Jwt;
using Baya.Infrastructure.Identity.ServiceConfiguration;
using Baya.Infrastructure.Monitoring.Configurations;
using Baya.Infrastructure.Persistence.ServiceConfiguration;
using Baya.SharedKernel.Extensions;
using Baya.Web.Api.Controllers.V1.UserManagement;
using Baya.Web.Plugins.Grpc;
using Baya.WebFramework.Filters;
using Baya.WebFramework.Middlewares;
using Baya.WebFramework.ServiceConfiguration;
using Baya.WebFramework.Swagger;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Serilog;
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"SqlServer": "Data Source=localhost;Initial Catalog=CleanArc_DB_8_0;Integrated Security=true;Encrypt=False"
"SqlServer": "Data Source=localhost;Initial Catalog=Baya_DB_8_0;Integrated Security=true;Encrypt=False"
},
"Logging": {
"LogLevel": {
@@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"SqlServer": "Server=sql_server2022;Database=CleanArc_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false",
"logDb": "Server=sql_server2022;Database=CleanArc_Log_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false"
"SqlServer": "Server=sql_server2022;Database=Baya_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false",
"logDb": "Server=sql_server2022;Database=Baya_Log_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false"
},
"IdentitySettings": {
"SecretKey": "ShouldBe-LongerThan-16Char-SecretKey",
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.Attributes;
namespace Baya.WebFramework.Attributes;
/// <summary>
/// Documents the 200 OK response type of endpoint as ApiResult
@@ -1,10 +1,10 @@
using System.Security.Claims;
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.Extensions;
using CleanArc.WebFramework.Filters;
using Baya.Application.Models.Common;
using Baya.SharedKernel.Extensions;
using Baya.WebFramework.Filters;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.BaseController;
namespace Baya.WebFramework.BaseController;
public class BaseController : ControllerBase
{
@@ -14,10 +14,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.CrossCutting\CleanArc.Infrastructure.CrossCutting.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Identity\CleanArc.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Persistence\CleanArc.Infrastructure.Persistence.csproj" />
<ProjectReference Include="..\..\Core\Baya.Application\Baya.Application.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.CrossCutting\Baya.Infrastructure.CrossCutting.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Identity\Baya.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Persistence\Baya.Infrastructure.Persistence.csproj" />
</ItemGroup>
</Project>
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class BadRequestResultEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using FluentValidation;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class ModelStateValidationEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class NotFoundResultEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class OkResultEndpointFilter:IEndpointFilter
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
[Obsolete(message:"Separated filters added")]
public class ApiResultFilterAttribute : ResultFilterAttribute
@@ -1,10 +1,10 @@
using CleanArc.Application.Models.ApiResult;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Models.ApiResult;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class BadRequestResultFilterAttribute : ActionFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ContentResultFilterAttribute : ResultFilterAttribute
{
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.ApiResult;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Models.ApiResult;
using Baya.SharedKernel.Extensions;
using FluentValidation;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using StatusCodes = Microsoft.AspNetCore.Http.StatusCodes;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ModelStateValidationAttribute : ActionFilterAttribute
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class NotFoundResultAttribute : ResultFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class OkResultAttribute:ResultFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ServerErrorResult:IActionResult
{
@@ -1,12 +1,12 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using CleanArc.SharedKernel.Extensions;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace CleanArc.WebFramework.Middlewares;
namespace Baya.WebFramework.Middlewares;
public class ExceptionHandler(ILogger<ExceptionHandler> logger,IWebHostEnvironment environment) : IExceptionHandler
{
@@ -1,7 +1,7 @@
using Asp.Versioning;
using Microsoft.Extensions.DependencyInjection;
namespace CleanArc.WebFramework.ServiceConfiguration;
namespace Baya.WebFramework.ServiceConfiguration;
public static class ServiceCollectionExtension
{
@@ -1,8 +1,8 @@
using CleanArc.SharedKernel.Extensions;
using Baya.SharedKernel.Extensions;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class ApiVersionDocumentProcessor: IDocumentProcessor
{
@@ -3,7 +3,7 @@ using NSwag.Generation.Processors.Contexts;
using Pluralize.NET;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class ApplySummariesOperationFilter : IOperationProcessor
{
@@ -3,7 +3,7 @@ using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class CustomTokenRequiredOperationFilter : IOperationProcessor
{
@@ -1,4 +1,4 @@
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
/// <summary>
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NSwag;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public static class SwaggerConfigurationExtensions
{
@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\..\Core\Baya.Application\Baya.Application.csproj" />
</ItemGroup>
<ItemGroup>
@@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using CleanArc.Web.Plugins.Grpc.Services;
using Baya.Web.Plugins.Grpc.Services;
namespace CleanArc.Web.Plugins.Grpc;
namespace Baya.Web.Plugins.Grpc;
public static class GrpcPluginStartup
{
@@ -1,6 +1,6 @@
syntax = "proto3";
option csharp_namespace = "CleanArc.Web.Plugins.Grpc.ProtoModels";
option csharp_namespace = "Baya.Web.Plugins.Grpc.ProtoModels";
import "google/protobuf/empty.proto";
package GrpcOrderController;
@@ -1,7 +1,7 @@

syntax = "proto3";
option csharp_namespace = "CleanArc.Web.Plugins.Grpc.ProtoModels";
option csharp_namespace = "Baya.Web.Plugins.Grpc.ProtoModels";
package GrpcUserController;
@@ -1,12 +1,12 @@
using CleanArc.Application.Features.Order.Queries.GetUserOrders;
using CleanArc.SharedKernel.Extensions;
using CleanArc.Web.Plugins.Grpc.ProtoModels;
using Baya.Application.Features.Order.Queries.GetUserOrders;
using Baya.SharedKernel.Extensions;
using Baya.Web.Plugins.Grpc.ProtoModels;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Mediator;
using Microsoft.AspNetCore.Authorization;
namespace CleanArc.Web.Plugins.Grpc.Services
namespace Baya.Web.Plugins.Grpc.Services
{
[Authorize]
public class OrderGrpcServices:OrderServices.OrderServicesBase
@@ -1,10 +1,10 @@
using CleanArc.Application.Features.Users.Queries.GenerateUserToken;
using CleanArc.Application.Features.Users.Queries.TokenRequest;
using CleanArc.Web.Plugins.Grpc.ProtoModels;
using Baya.Application.Features.Users.Queries.GenerateUserToken;
using Baya.Application.Features.Users.Queries.TokenRequest;
using Baya.Web.Plugins.Grpc.ProtoModels;
using Grpc.Core;
using Mediator;
namespace CleanArc.Web.Plugins.Grpc.Services;
namespace Baya.Web.Plugins.Grpc.Services;
public class UserGrpcServices : UserServices.UserServicesBase
{