Browse Source

增加审计日志模块

main-auditlogging
shuangbaojun 5 years ago
parent
commit
40d5a2c234
  1. 1037
      aspnet-core/Lion.AbpPro.sln
  2. 128
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/AuditLoggingManagementHttpApiHostModule.cs
  3. 13
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Controllers/HomeController.cs
  4. 25
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/EntityFrameworkCore/AuditLoggingManagementHttpApiHostMigrationsDbContext.cs
  5. 25
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/EntityFrameworkCore/AuditLoggingManagementHttpApiHostMigrationsDbContextFactory.cs
  6. 38
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.csproj
  7. 164
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Logs/logs.txt
  8. 325
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/20220302122446_Init.Designer.cs
  9. 203
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/20220302122446_Init.cs
  10. 323
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/AuditLoggingManagementHttpApiHostMigrationsDbContextModelSnapshot.cs
  11. 48
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Program.cs
  12. 14
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Properties/launchSettings.json
  13. 15
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Startup.cs
  14. 11
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/appsettings.Development.json
  15. 12
      aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/appsettings.json
  16. 18
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLoggingManagementApplicationContractsModule.cs
  17. 19
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/AuditLogActionOutput.cs
  18. 39
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/AuditLogOutput.cs
  19. 31
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/EntityChangeOutput.cs
  20. 23
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/EntityPropertyChangeOutput.cs
  21. 41
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/GetAuditLogsInput.cs
  22. 32
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/GetEntityChangesInput.cs
  23. 17
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/IAuditLogAppService.cs
  24. 20
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Lion.AbpPro.AuditLoggingManagement.Application.Contracts.csproj
  25. 24
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Permissions/AuditLogManagementPermissionDefinitionProvider.cs
  26. 21
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Permissions/AuditLogManagementPermissions.cs
  27. 14
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLoggingManagementAppServiceBase.cs
  28. 28
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLoggingManagementApplicationModule.cs
  29. 86
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLogs/AuditLogAppService.cs
  30. 17
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLogs/Mappers/AuditLogApplicationAutoMapperProfile.cs
  31. 17
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/Lion.AbpPro.AuditLoggingManagement.Application.csproj
  32. 19
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/AuditLogManagementDomainErrorCodes.cs
  33. 39
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/AuditLoggManagementDomainSharedModule.cs
  34. 24
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Lion.AbpPro.AuditLoggingManagement.Domain.Shared.csproj
  35. 6
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagement/en.json
  36. 6
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagement/zh-Hans.json
  37. 14
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagementResource.cs
  38. 18
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client/AuditLoggingManagementHttpApiClientModule.cs
  39. 16
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client.csproj
  40. 22
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/AuditLoggingManagementHttpApiModule.cs
  41. 51
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/AuditLogs/AuditLogController.cs
  42. 18
      aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/Lion.AbpPro.AuditLoggingManagement.HttpApi.csproj
  43. 23
      aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.Application.Tests/Lion.AbpPro.AuditLoggingManagement.Application.Tests.csproj
  44. 13
      aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.Application.Tests/UnitTest1.cs
  45. 23
      aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.TestBase/Lion.AbpPro.AuditLoggingManagement.TestBase.csproj

1037
aspnet-core/Lion.AbpPro.sln

File diff suppressed because it is too large

128
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/AuditLoggingManagementHttpApiHostModule.cs

@ -0,0 +1,128 @@
using Lion.AbpPro.Shared.Hosting.Microservices;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.OpenApi.Models;
using Volo.Abp;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Modularity;
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host
{
[DependsOn(
typeof(AuditLoggingManagementApplicationModule),
typeof(AuditLoggingManagementHttpApiModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(SharedHostingMicroserviceModule),
typeof(AbpAutofacModule),
typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class AuditLoggingManagementHttpApiHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
ConfigureSwaggerServices(context);
ConfigureDB(context);
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage(); // 建议开启,方便开发排错
}
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpRequestLocalization();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "AuditLoggingManagement API");
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
}
/// <summary>
/// 配置SwaggerUI
/// </summary>
/// <param name="context"></param>
private static void ConfigureSwaggerServices(ServiceConfigurationContext context)
{
context.Services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "AuditLoggingManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
#region 添加token
options.AddSecurityDefinition(JwtBearerDefaults.AuthenticationScheme, new OpenApiSecurityScheme()
{
Description = "请输入Token",
Name = "Authorization",
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Scheme = JwtBearerDefaults.AuthenticationScheme,
BearerFormat = "JWT"
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme, Id = "Bearer"
}
},
new List<string>()
}
});
options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme()
{
Type = SecuritySchemeType.ApiKey,
In = ParameterLocation.Header,
Name = "Accept-Language",
Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans"
});
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference{ Type = ReferenceType.SecurityScheme, Id = "ApiKey" }
},
Array.Empty<string>()
}
});
#endregion
});
}
private void ConfigureDB(ServiceConfigurationContext context)
{
Configure<AbpDbContextOptions>(options =>
{
options.UseMySQL();
});
}
}
}

13
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Controllers/HomeController.cs

@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.Controllers
{
public class HomeController : AbpController
{
public ActionResult Index()
{
return Redirect("~/swagger");
}
}
}

25
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/EntityFrameworkCore/AuditLoggingManagementHttpApiHostMigrationsDbContext.cs

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.EntityFrameworkCore
{
[ConnectionStringName("AbpAuditLogging")]
public class AuditLoggingManagementHttpApiHostMigrationsDbContext : AbpDbContext<AuditLoggingManagementHttpApiHostMigrationsDbContext>
{
public DbSet<AuditLog> AuditLogs { get; set; }
public AuditLoggingManagementHttpApiHostMigrationsDbContext(DbContextOptions<AuditLoggingManagementHttpApiHostMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureAuditLogging();
}
}
}

25
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/EntityFrameworkCore/AuditLoggingManagementHttpApiHostMigrationsDbContextFactory.cs

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.EntityFrameworkCore
{
public class AuditLoggingManagementHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory<AuditLoggingManagementHttpApiHostMigrationsDbContext>
{
public AuditLoggingManagementHttpApiHostMigrationsDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<AuditLoggingManagementHttpApiHostMigrationsDbContext>()
.UseMySql(configuration.GetConnectionString("AbpAuditLogging"), MySqlServerVersion.LatestSupportedServerVersion);
return new AuditLoggingManagementHttpApiHostMigrationsDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
}
}
}

38
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.csproj

@ -0,0 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="../../../../common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Lion.AbpPro.AuditLoggingManagement.HttpApi.Host</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Data" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(AbpPackageVersion)" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\shared\Lion.AbpPro.Shared.Hosting.Microservices\Lion.AbpPro.Shared.Hosting.Microservices.csproj" />
<ProjectReference Include="..\..\src\Lion.AbpPro.AuditLoggingManagement.Application\Lion.AbpPro.AuditLoggingManagement.Application.csproj" />
<ProjectReference Include="..\..\src\Lion.AbpPro.AuditLoggingManagement.HttpApi\Lion.AbpPro.AuditLoggingManagement.HttpApi.csproj" />
</ItemGroup>
</Project>

164
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Logs/logs.txt

@ -0,0 +1,164 @@
2022-03-13 21:59:37.640 +08:00 [INF] Starting web host.
2022-03-13 21:59:49.022 +08:00 [INF] User profile is available. Using 'C:\Users\Administrator\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2022-03-13 21:59:49.247 +08:00 [INF] Creating key {d1749119-66b3-48ae-9d21-6a34e636a937} with creation date 2022-03-13 13:59:49Z, activation date 2022-03-14 14:01:47Z, and expiration date 2022-06-11 13:59:49Z.
2022-03-13 21:59:49.259 +08:00 [INF] Writing data to file 'C:\Users\Administrator\AppData\Local\ASP.NET\DataProtection-Keys\key-d1749119-66b3-48ae-9d21-6a34e636a937.xml'.
2022-03-13 21:59:49.408 +08:00 [INF] Loaded ABP modules:
2022-03-13 21:59:49.408 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.AuditLoggingManagementHttpApiHostModule
2022-03-13 21:59:49.408 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementApplicationModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Data.AbpDataModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.ObjectExtending.AbpObjectExtendingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Validation.AbpValidationAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Json.AbpJsonModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Timing.AbpTimingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Security.AbpSecurityModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingContractsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Specifications.AbpSpecificationsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationContractsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Validation.AbpValidationModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Features.AbpFeaturesModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
2022-03-13 21:59:49.408 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementApplicationContractsModule
2022-03-13 21:59:49.408 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.Domain.Shared.AuditLoggManagementDomainSharedModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
2022-03-13 21:59:49.408 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementHttpApiModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Http.AbpHttpModule
2022-03-13 21:59:49.408 +08:00 [INF] - Volo.Abp.Minify.AbpMinifyModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.UI.Navigation.AbpUiNavigationModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.UI.AbpUiModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
2022-03-13 21:59:49.409 +08:00 [INF] - Lion.AbpPro.Shared.Hosting.Microservices.SharedHostingMicroserviceModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.Swashbuckle.AbpSwashbuckleModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.MySQL.AbpEntityFrameworkCoreMySQLModule
2022-03-13 21:59:49.409 +08:00 [INF] - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule
2022-03-13 21:59:51.169 +08:00 [INF] Initialized all ABP modules.
2022-03-13 21:59:51.455 +08:00 [INF] Now listening on: http://localhost:5105
2022-03-13 21:59:51.455 +08:00 [INF] Application started. Press Ctrl+C to shut down.
2022-03-13 21:59:51.455 +08:00 [INF] Hosting environment: Development
2022-03-13 21:59:51.455 +08:00 [INF] Content root path: D:\工作\abp-vnext-pro\aspnet-core\modules\AuditLoggingManagement\host\Lion.AbpPro.AuditLoggingManagement.HttpApi.Host
2022-03-13 21:59:52.244 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger - -
2022-03-13 21:59:52.386 +08:00 [WRN] Failed to determine the https port for redirect.
2022-03-13 21:59:52.753 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger - - - 301 0 - 507.5604ms
2022-03-13 21:59:52.760 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/index.html - -
2022-03-13 21:59:53.102 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui.css - -
2022-03-13 21:59:53.104 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/ui/abp.js - -
2022-03-13 21:59:53.104 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/ui/abp.swagger.js - -
2022-03-13 21:59:53.116 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui-standalone-preset.js - -
2022-03-13 21:59:53.116 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui-bundle.js - -
2022-03-13 21:59:53.147 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/index.html - - - 200 - text/html;charset=utf-8 386.3674ms
2022-03-13 21:59:53.152 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/_framework/aspnetcore-browser-refresh.js - -
2022-03-13 21:59:53.155 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/_framework/aspnetcore-browser-refresh.js - - - 200 11981 application/javascript;+charset=utf-8 3.2127ms
2022-03-13 21:59:53.159 +08:00 [INF] Sending file. Request path: '/swagger/ui/abp.js'. Physical path: 'N/A'
2022-03-13 21:59:53.159 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/ui/abp.js - - - 200 3122 application/javascript 55.8511ms
2022-03-13 21:59:53.160 +08:00 [INF] Sending file. Request path: '/swagger/ui/abp.swagger.js'. Physical path: 'N/A'
2022-03-13 21:59:53.161 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/ui/abp.swagger.js - - - 200 1057 application/javascript 56.7627ms
2022-03-13 21:59:53.173 +08:00 [INF] Sending file. Request path: '/swagger-ui-standalone-preset.js'. Physical path: 'N/A'
2022-03-13 21:59:53.173 +08:00 [INF] Sending file. Request path: '/swagger-ui.css'. Physical path: 'N/A'
2022-03-13 21:59:53.173 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui-standalone-preset.js - - - 200 337162 application/javascript 57.8838ms
2022-03-13 21:59:53.174 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui.css - - - 200 143632 text/css 72.0725ms
2022-03-13 21:59:53.218 +08:00 [INF] Sending file. Request path: '/swagger-ui-bundle.js'. Physical path: 'N/A'
2022-03-13 21:59:53.219 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/swagger-ui-bundle.js - - - 200 1092889 application/javascript 103.0417ms
2022-03-13 21:59:53.525 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/v1/swagger.json - -
2022-03-13 21:59:53.591 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/favicon-32x32.png - -
2022-03-13 21:59:53.591 +08:00 [INF] Sending file. Request path: '/favicon-32x32.png'. Physical path: 'N/A'
2022-03-13 21:59:53.592 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/favicon-32x32.png - - - 200 628 image/png 0.9992ms
2022-03-13 21:59:53.860 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/v1/swagger.json - - - 200 - application/json;charset=utf-8 335.1265ms
2022-03-13 22:01:20.351 +08:00 [INF] Starting web host.
2022-03-13 22:01:23.783 +08:00 [INF] User profile is available. Using 'C:\Users\Administrator\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2022-03-13 22:01:23.903 +08:00 [INF] Loaded ABP modules:
2022-03-13 22:01:23.903 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.AuditLoggingManagementHttpApiHostModule
2022-03-13 22:01:23.903 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementApplicationModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Data.AbpDataModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.ObjectExtending.AbpObjectExtendingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Validation.AbpValidationAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Json.AbpJsonModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Timing.AbpTimingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Security.AbpSecurityModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingContractsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Specifications.AbpSpecificationsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationContractsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Validation.AbpValidationModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
2022-03-13 22:01:23.903 +08:00 [INF] - Volo.Abp.Features.AbpFeaturesModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
2022-03-13 22:01:23.904 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementApplicationContractsModule
2022-03-13 22:01:23.904 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.Domain.Shared.AuditLoggManagementDomainSharedModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
2022-03-13 22:01:23.904 +08:00 [INF] - Lion.AbpPro.AuditLoggingManagement.AuditLoggingManagementHttpApiModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.Http.AbpHttpModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.Minify.AbpMinifyModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.UI.Navigation.AbpUiNavigationModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.UI.AbpUiModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
2022-03-13 22:01:23.904 +08:00 [INF] - Lion.AbpPro.Shared.Hosting.Microservices.SharedHostingMicroserviceModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.Swashbuckle.AbpSwashbuckleModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.MySQL.AbpEntityFrameworkCoreMySQLModule
2022-03-13 22:01:23.904 +08:00 [INF] - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule
2022-03-13 22:01:24.509 +08:00 [INF] Initialized all ABP modules.
2022-03-13 22:01:24.611 +08:00 [INF] Now listening on: http://localhost:5105
2022-03-13 22:01:24.611 +08:00 [INF] Application started. Press Ctrl+C to shut down.
2022-03-13 22:01:24.611 +08:00 [INF] Hosting environment: Development
2022-03-13 22:01:24.611 +08:00 [INF] Content root path: D:\工作\abp-vnext-pro\aspnet-core\modules\AuditLoggingManagement\host\Lion.AbpPro.AuditLoggingManagement.HttpApi.Host
2022-03-13 22:01:25.476 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/index.html - -
2022-03-13 22:01:25.533 +08:00 [WRN] Failed to determine the https port for redirect.
2022-03-13 22:01:25.908 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/_framework/aspnetcore-browser-refresh.js - -
2022-03-13 22:01:25.911 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/_framework/aspnetcore-browser-refresh.js - - - 200 11981 application/javascript;+charset=utf-8 2.4372ms
2022-03-13 22:01:25.915 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/index.html - - - 200 - text/html;charset=utf-8 441.9388ms
2022-03-13 22:01:26.243 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:5105/swagger/v1/swagger.json - -
2022-03-13 22:01:26.487 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:5105/swagger/v1/swagger.json - - - 200 - application/json;charset=utf-8 244.4706ms

325
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/20220302122446_Init.Designer.cs

@ -0,0 +1,325 @@
// <auto-generated />
using System;
using Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.Migrations
{
[DbContext(typeof(AuditLoggingManagementHttpApiHostMigrationsDbContext))]
[Migration("20220302122446_Init")]
partial class Init
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<string>("ApplicationName")
.HasMaxLength(96)
.HasColumnType("varchar(96)")
.HasColumnName("ApplicationName");
b.Property<string>("BrowserInfo")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("BrowserInfo");
b.Property<string>("ClientId")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ClientId");
b.Property<string>("ClientIpAddress")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ClientIpAddress");
b.Property<string>("ClientName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("ClientName");
b.Property<string>("Comments")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("Comments");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("CorrelationId");
b.Property<string>("Exceptions")
.HasColumnType("longtext");
b.Property<int>("ExecutionDuration")
.HasColumnType("int")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasMaxLength(16)
.HasColumnType("varchar(16)")
.HasColumnName("HttpMethod");
b.Property<int?>("HttpStatusCode")
.HasColumnType("int")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnType("char(36)")
.HasColumnName("ImpersonatorTenantId");
b.Property<string>("ImpersonatorTenantName")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ImpersonatorTenantName");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnType("char(36)")
.HasColumnName("ImpersonatorUserId");
b.Property<string>("ImpersonatorUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ImpersonatorUserName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("TenantName")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("TenantName");
b.Property<string>("Url")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("Url");
b.Property<Guid?>("UserId")
.HasColumnType("char(36)")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("UserName");
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnType("char(36)")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnType("int")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("MethodName");
b.Property<string>("Parameters")
.HasMaxLength(2000)
.HasColumnType("varchar(2000)")
.HasColumnName("Parameters");
b.Property<string>("ServiceName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ServiceName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnType("char(36)")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnType("datetime(6)")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnType("tinyint unsigned")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("EntityId");
b.Property<Guid?>("EntityTenantId")
.HasColumnType("char(36)");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("EntityTypeFullName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("EntityChangeId")
.HasColumnType("char(36)");
b.Property<string>("NewValue")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("NewValue");
b.Property<string>("OriginalValue")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("OriginalValue");
b.Property<string>("PropertyName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("PropertyName");
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("PropertyTypeFullName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null)
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");
b.Navigation("EntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Navigation("PropertyChanges");
});
#pragma warning restore 612, 618
}
}
}

203
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/20220302122446_Init.cs

@ -0,0 +1,203 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.Migrations
{
public partial class Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationName = table.Column<string>(type: "varchar(96)", maxLength: 96, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ImpersonatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ImpersonatorUserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ImpersonatorTenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ImpersonatorTenantName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecutionTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ExecutionDuration = table.Column<int>(type: "int", nullable: false),
ClientIpAddress = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CorrelationId = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
BrowserInfo = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HttpMethod = table.Column<string>(type: "varchar(16)", maxLength: 16, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Url = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Exceptions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Comments = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HttpStatusCode = table.Column<int>(type: "int", nullable: true),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AuditLogId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MethodName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Parameters = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecutionTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ExecutionDuration = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AuditLogId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ChangeTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ChangeType = table.Column<byte>(type: "tinyint unsigned", nullable: false),
EntityTenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EntityId = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EntityTypeFullName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EntityChangeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NewValue = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OriginalValue = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PropertyName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PropertyTypeFullName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Execution~",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
}
}
}

323
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Migrations/AuditLoggingManagementHttpApiHostMigrationsDbContextModelSnapshot.cs

@ -0,0 +1,323 @@
// <auto-generated />
using System;
using Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host.Migrations
{
[DbContext(typeof(AuditLoggingManagementHttpApiHostMigrationsDbContext))]
partial class AuditLoggingManagementHttpApiHostMigrationsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<string>("ApplicationName")
.HasMaxLength(96)
.HasColumnType("varchar(96)")
.HasColumnName("ApplicationName");
b.Property<string>("BrowserInfo")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("BrowserInfo");
b.Property<string>("ClientId")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ClientId");
b.Property<string>("ClientIpAddress")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ClientIpAddress");
b.Property<string>("ClientName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("ClientName");
b.Property<string>("Comments")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("Comments");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("CorrelationId");
b.Property<string>("Exceptions")
.HasColumnType("longtext");
b.Property<int>("ExecutionDuration")
.HasColumnType("int")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasMaxLength(16)
.HasColumnType("varchar(16)")
.HasColumnName("HttpMethod");
b.Property<int?>("HttpStatusCode")
.HasColumnType("int")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnType("char(36)")
.HasColumnName("ImpersonatorTenantId");
b.Property<string>("ImpersonatorTenantName")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("ImpersonatorTenantName");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnType("char(36)")
.HasColumnName("ImpersonatorUserId");
b.Property<string>("ImpersonatorUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ImpersonatorUserName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("TenantName")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("TenantName");
b.Property<string>("Url")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("Url");
b.Property<Guid?>("UserId")
.HasColumnType("char(36)")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("UserName");
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnType("char(36)")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnType("int")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("datetime(6)")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("MethodName");
b.Property<string>("Parameters")
.HasMaxLength(2000)
.HasColumnType("varchar(2000)")
.HasColumnName("Parameters");
b.Property<string>("ServiceName")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ServiceName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("AuditLogId")
.HasColumnType("char(36)")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnType("datetime(6)")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnType("tinyint unsigned")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("EntityId");
b.Property<Guid?>("EntityTenantId")
.HasColumnType("char(36)");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("EntityTypeFullName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<Guid>("EntityChangeId")
.HasColumnType("char(36)");
b.Property<string>("NewValue")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("NewValue");
b.Property<string>("OriginalValue")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("OriginalValue");
b.Property<string>("PropertyName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("PropertyName");
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("PropertyTypeFullName");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null)
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");
b.Navigation("EntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Navigation("PropertyChanges");
});
#pragma warning restore 612, 618
}
}
}

48
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Program.cs

@ -0,0 +1,48 @@
using Lion.AbpPro.AuditLoggingManagement.HttpApi.Host;
using Serilog;
using Serilog.Events;
public class Program
{
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}

14
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Properties/launchSettings.json

@ -0,0 +1,14 @@
{
"profiles": {
"Lion.AbpPro.AuditLoggingManagement.HttpApi.Host": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5105",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

15
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/Startup.cs

@ -0,0 +1,15 @@
namespace Lion.AbpPro.AuditLoggingManagement.HttpApi.Host
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AuditLoggingManagementHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

11
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/appsettings.Development.json

@ -0,0 +1,11 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"AbpAuditLogging": "Data Source=localhost;Port=3306;Database=AuditLoggingManagement;uid=root;pwd=1234;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
}
}

12
aspnet-core/modules/AuditLoggingManagement/host/Lion.AbpPro.AuditLoggingManagement.HttpApi.Host/appsettings.json

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"AbpAuditLogging": "Data Source=localhost;Port=3306;Database=AuditLoggingManagement;uid=root;pwd=1234;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
},
"AllowedHosts": "*"
}

18
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLoggingManagementApplicationContractsModule.cs

@ -0,0 +1,18 @@
using Lion.AbpPro.AuditLoggingManagement.Domain.Shared;
using Volo.Abp.Application;
using Volo.Abp.AuditLogging;
using Volo.Abp.Authorization;
using Volo.Abp.Modularity;
namespace Lion.AbpPro.AuditLoggingManagement
{
[DependsOn(
typeof(AuditLoggManagementDomainSharedModule),
typeof(AbpAuditLoggingDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationAbstractionsModule)
)]
public class AuditLoggingManagementApplicationContractsModule : AbpModule
{
}
}

19
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/AuditLogActionOutput.cs

@ -0,0 +1,19 @@
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class AuditLogActionOutput
{
public Guid? Id { set; get; }
public Guid? TenantId { set; get; }
public string ServiceName { set; get; }
public string MethodName { set; get; }
public string Parameters { set; get; }
public DateTime ExecutionTime { set; get; }
public int ExecutionDuration { set; get; }
}
}

39
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/AuditLogOutput.cs

@ -0,0 +1,39 @@
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class AuditLogOutput
{
public Guid Id { set; get; }
public string ApplicationName { get; set; }
public Guid? UserId { get; set; }
public string UserName { get; set; }
public Guid? TenantId { get; set; }
public string TenantName { get; set; }
public DateTime ExecutionTime { get; set; }
public int ExecutionDuration { get; set; }
public string ClientIpAddress { get; set; }
public string ClientName { get; set; }
public string CorrelationId { get; set; }
public string HttpMethod { get; set; }
public string Url { get; set; }
public string Exceptions { get; set; }
public int? HttpStatusCode { get; set; }
//public ICollection<EntityChangeOutput> EntityChanges { get; set; }
public ICollection<AuditLogActionOutput> Actions { get; set; }
}
}

31
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/EntityChangeOutput.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Auditing;
using Volo.Abp.Data;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class EntityChangeOutput
{
public Guid AuditLogId { get; set; }
public Guid? TenantId { get; set; }
public DateTime ChangeTime { get; set; }
public EntityChangeType ChangeType { get; set; }
public Guid? EntityTenantId { get; set; }
public string EntityId { get; set; }
public string EntityTypeFullName { get; set; }
public ICollection<EntityPropertyChangeOutput> PropertyChanges { get; set; }
public ExtraPropertyDictionary ExtraProperties { get; set; }
}
}

23
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/EntityPropertyChangeOutput.cs

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class EntityPropertyChangeOutput
{
public Guid? TenantId { get; set; }
public Guid EntityChangeId { get; set; }
public string NewValue { get; set; }
public string OriginalValue { get; set; }
public string PropertyName { get; set; }
public string PropertyTypeFullName { get; set; }
}
}

41
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/GetAuditLogsInput.cs

@ -0,0 +1,41 @@
using System.Net;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class GetAuditLogsInput
{
public string Sorting { get; set; }
public int MaxResultCount { get; set; } = 50;
public int SkipCount { get; set; } = 0;
public DateTime? StartExecutionTime { get; set; }
public DateTime? EndExecutionTime { get; set; }
public string HttpMethod { get; set; }
public string Url { get; set; }
public Guid? UserId { get; set; }
public string UserName { get; set; }
public string ApplicationName { get; set; }
public string ClientIpAddress { get; set; }
public string CorrelationId { get; set; }
public int? MaxExecutionDuration { get; set; }
public int? MinExecutionDuration { get; set; }
public bool? HasException { get; set; }
public HttpStatusCode? HttpStatusCode { get; set;}
public bool IncludeDetails { get; set; } = true;
}
}

32
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/Dtos/GetEntityChangesInput.cs

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Auditing;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos
{
public class GetEntityChangesInput
{
public string Sorting { set; get; }
public int MaxResultCount { set; get; } = 50;
public int SkipCount { set; get; } = 0;
public Guid? AuditLogId { set; get; }
public DateTime? StartTime { set; get; }
public DateTime? SndTime { set; get; }
public EntityChangeType? ChangeType { set; get; }
public string EntityId { set; get; }
public string EntityTypeFullName { set; get; }
public bool IncludeDetails { set; get; } = true;
}
}

17
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/AuditLogs/IAuditLogAppService.cs

@ -0,0 +1,17 @@
using Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs
{
public interface IAuditLogAppService : IApplicationService
{
Task<ListResultDto<AuditLogOutput>> GetPageListAsync(GetAuditLogsInput input, CancellationToken cancellationToken = default);
Task<ListResultDto<EntityChangeOutput>> GetEntityChangePageListAsync(GetEntityChangesInput input, CancellationToken cancellationToken = default);
Task<AuditLogOutput> GetAsync(Guid id, CancellationToken cancellationToken = default);
Task DeleteAsync(Guid id, CancellationToken cancellationToken = default);
}
}

20
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Lion.AbpPro.AuditLoggingManagement.Application.Contracts.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../../../common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Lion.AbpPro.AuditLoggingManagement</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Authorization" Version="$(AbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\frameworks\Extensions\src\Lion.AbpPro.Extension\Lion.AbpPro.Extension.csproj" />
<ProjectReference Include="..\Lion.AbpPro.AuditLoggingManagement.Domain.Shared\Lion.AbpPro.AuditLoggingManagement.Domain.Shared.csproj" />
</ItemGroup>
</Project>

24
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Permissions/AuditLogManagementPermissionDefinitionProvider.cs

@ -0,0 +1,24 @@
using Lion.AbpPro.AuditLoggingManagement.Domain.Shared.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace Lion.AbpPro.AuditLoggingManagement.Permissions
{
public class AuditLogManagementPermissionDefinitionProvider : PermissionDefinitionProvider
{
public const string GroupName = "AuditLogManagement";
public override void Define(IPermissionDefinitionContext context)
{
var auditLogsGroup = context.AddGroup(GroupName, L("AuditLogManagement"));
var auditLogs = auditLogsGroup.AddPermission(AuditLogManagementPermissions.AuditLogs.Default, L("Permission:AuditLogManagement.AuditLogs"));
auditLogs.AddChild(AuditLogManagementPermissions.AuditLogs.Delete, L("Permission:AuditLogManagement.AuditLogs.Delete"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<AuditLogManagementResource>(name);
}
}
}

21
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application.Contracts/Permissions/AuditLogManagementPermissions.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lion.AbpPro.AuditLoggingManagement.Permissions
{
public class AuditLogManagementPermissions
{
public const string GroupName = "AuditLogManagement";
public static class AuditLogs
{
public const string Default = GroupName + ".AuditLogs";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
}
}
}

14
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLoggingManagementAppServiceBase.cs

@ -0,0 +1,14 @@
using Lion.AbpPro.AuditLoggingManagement.Domain.Shared.Localization;
using Volo.Abp.Application.Services;
namespace Lion.AbpPro.AuditLoggingManagement
{
public abstract class AuditLoggingManagementAppServiceBase : ApplicationService
{
protected AuditLoggingManagementAppServiceBase()
{
LocalizationResource = typeof(AuditLogManagementResource);
ObjectMapperContext = typeof(AuditLoggingManagementApplicationModule);
}
}
}

28
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLoggingManagementApplicationModule.cs

@ -0,0 +1,28 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.AuditLogging;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
namespace Lion.AbpPro.AuditLoggingManagement
{
[DependsOn(
typeof(AbpDddApplicationModule),
typeof(AbpAutofacModule),
typeof(AuditLoggingManagementApplicationContractsModule),
typeof(AbpAuditLoggingDomainModule),
typeof(AbpAutoMapperModule)
)]
public class AuditLoggingManagementApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AuditLoggingManagementApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<AuditLoggingManagementApplicationModule>();
});
}
}
}

86
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLogs/AuditLogAppService.cs

@ -0,0 +1,86 @@
using Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AuditLogging;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs
{
public class AuditLogAppService : AuditLoggingManagementAppServiceBase, IAuditLogAppService
{
private readonly IAuditLogRepository _auditLogRepository;
public AuditLogAppService(IAuditLogRepository auditLogRepository)
{
_auditLogRepository = auditLogRepository;
}
public async Task<ListResultDto<AuditLogOutput>> GetPageListAsync(GetAuditLogsInput input, CancellationToken cancellationToken = default)
{
var auditLogs = await _auditLogRepository.GetListAsync(
input.Sorting,
input.MaxResultCount,
input.SkipCount,
input.StartExecutionTime,
input.EndExecutionTime,
input.HttpMethod,
input.Url,
input.UserId,
input.UserName,
input.ApplicationName,
input.ClientIpAddress,
input.CorrelationId,
input.MaxExecutionDuration,
input.MinExecutionDuration,
input.HasException,
input.HttpStatusCode,
input.IncludeDetails,
cancellationToken
);
var datas = ObjectMapper.Map<List<AuditLog>, List<AuditLogOutput>>(auditLogs);
return new ListResultDto<AuditLogOutput>(datas);
}
public async Task<AuditLogOutput> GetAsync(Guid id, CancellationToken cancellationToken = default)
{
var auditLog = await _auditLogRepository.FindAsync(model => model.Id == id, cancellationToken: cancellationToken);
if (null == auditLog)
{
throw new UserFriendlyException(L["AuditLogNotFound", id]);
}
return ObjectMapper.Map<AuditLog, AuditLogOutput>(auditLog);
}
public async Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)
{
var auditLog = await _auditLogRepository.FindAsync(model => model.Id == id, cancellationToken: cancellationToken);
if (null == auditLog)
{
throw new UserFriendlyException(L["AuditLogNotFound", id]);
}
await _auditLogRepository.DeleteAsync(auditLog, cancellationToken: cancellationToken);
}
public async Task<ListResultDto<EntityChangeOutput>> GetEntityChangePageListAsync(GetEntityChangesInput input, CancellationToken cancellationToken = default)
{
var entityChange = await _auditLogRepository.GetEntityChangeListAsync(
input.Sorting,
input.MaxResultCount,
input.SkipCount,
input.AuditLogId,
input.StartTime,
input.SndTime,
input.ChangeType,
input.EntityId,
input.EntityTypeFullName,
input.IncludeDetails,
cancellationToken);
var datas = ObjectMapper.Map<List<EntityChange>, List<EntityChangeOutput>>(entityChange);
return new ListResultDto<EntityChangeOutput>(datas);
}
}
}

17
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/AuditLogs/Mappers/AuditLogApplicationAutoMapperProfile.cs

@ -0,0 +1,17 @@
using AutoMapper;
using Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos;
using Volo.Abp.AuditLogging;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs.Mappers
{
public class AuditLogApplicationAutoMapperProfile : Profile
{
public AuditLogApplicationAutoMapperProfile()
{
CreateMap<AuditLog, AuditLogOutput>();
CreateMap<AuditLogAction, AuditLogActionOutput>();
CreateMap<EntityChange, EntityChangeOutput>();
CreateMap<EntityPropertyChange, EntityPropertyChangeOutput>();
}
}
}

17
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Application/Lion.AbpPro.AuditLoggingManagement.Application.csproj

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../../../common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Lion.AbpPro.AuditLoggingManagement</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="$(AbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lion.AbpPro.AuditLoggingManagement.Application.Contracts\Lion.AbpPro.AuditLoggingManagement.Application.Contracts.csproj" />
</ItemGroup>
</Project>

19
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/AuditLogManagementDomainErrorCodes.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lion.AbpPro.AuditLoggingManagement.Domain.Shared
{
public class AuditLogManagementDomainErrorCodes
{
public static class AuditLog
{
//public const string IdAlreadyExist = "DataDictionaryManagement:DataDictionary:0001";
//public const string IdNotExist = "DataDictionaryManagement:DataDictionary:0002";
//public const string CodeAlreadyExist = "DataDictionaryManagement:DataDictionary:0003";
//public const string CodeNotExist = "DataDictionaryManagement:DataDictionary:0004";
}
}
}

39
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/AuditLoggManagementDomainSharedModule.cs

@ -0,0 +1,39 @@
using Lion.AbpPro.AuditLoggingManagement.Domain.Shared.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Localization.Resources.AbpLocalization;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
namespace Lion.AbpPro.AuditLoggingManagement.Domain.Shared
{
[DependsOn(
typeof(AbpValidationModule),
typeof(AbpAuditLoggingDomainSharedModule)
)]
public class AuditLoggManagementDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AuditLoggManagementDomainSharedModule>(typeof(AuditLoggManagementDomainSharedModule).Namespace);
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<AuditLogManagementResource>("zh-Hans")
.AddVirtualJson("/Localization/AuditLogManagement");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("AuditLogManagement", typeof(AuditLogManagementResource));
});
}
}
}

24
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Lion.AbpPro.AuditLoggingManagement.Domain.Shared.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="Localization\AuditLogManagement\en.json" />
<None Remove="Localization\AuditLogManagement\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\AuditLogManagement\en.json" />
<EmbeddedResource Include="Localization\AuditLogManagement\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="$(AbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Validation" Version="$(AbpPackageVersion)" />
</ItemGroup>
</Project>

6
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagement/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"AuditLogNotFound": "AuditLog Id: {0} does not exist!"
}
}

6
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagement/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"AuditLogNotFound": "审计日志Id:{0}不存在"
}
}

14
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.Domain.Shared/Localization/AuditLogManagementResource.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Localization;
namespace Lion.AbpPro.AuditLoggingManagement.Domain.Shared.Localization
{
[LocalizationResourceName("AuditLogManagement")]
public class AuditLogManagementResource
{
}
}

18
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client/AuditLoggingManagementHttpApiClientModule.cs

@ -0,0 +1,18 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace Lion.AbpPro.AuditLoggingManagement
{
public class AuditLoggingManagementHttpApiClientModule : AbpModule
{
public const string RemoteServiceName = "AuditLoggingManagement";
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AuditLoggingManagementApplicationContractsModule).Assembly,
RemoteServiceName
);
}
}
}

16
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client/Lion.AbpPro.AuditLoggingManagement.HttpApi.Client.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../../../common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Lion.AbpPro.AuditLoggingManagement</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.1.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lion.AbpPro.AuditLoggingManagement.Application.Contracts\Lion.AbpPro.AuditLoggingManagement.Application.Contracts.csproj" />
</ItemGroup>
</Project>

22
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/AuditLoggingManagementHttpApiModule.cs

@ -0,0 +1,22 @@
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
namespace Lion.AbpPro.AuditLoggingManagement
{
[DependsOn(
typeof(AuditLoggingManagementApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class AuditLoggingManagementHttpApiModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
//options.Resources
// .Get<AuditlogResource>()
// .AddBaseTypes(typeof(AbpUiResource));
});
}
}
}

51
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/AuditLogs/AuditLogController.cs

@ -0,0 +1,51 @@
using Lion.AbpPro.AuditLoggingManagement.AuditLogs.Dtos;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
namespace Lion.AbpPro.AuditLoggingManagement.AuditLogs
{
[Route("api/auditlog-management/auditlogs")]
public class AuditLogController : AbpController, IAuditLogAppService
{
private IAuditLogAppService _auditLogAppService;
public AuditLogController(IAuditLogAppService auditLogAppService)
{
_auditLogAppService = auditLogAppService;
}
[HttpPost]
[Route("delete/{id}")]
[SwaggerOperation(summary: "通过审计日志Id删除审计日志", Tags = new[] { "Auditlogs" })]
public async Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)
{
await _auditLogAppService.DeleteAsync(id, cancellationToken);
}
[HttpPost]
[Route("page")]
[SwaggerOperation(summary: "分页获取审计日志", Tags = new[] { "Auditlogs" })]
public async Task<ListResultDto<AuditLogOutput>> GetPageListAsync(GetAuditLogsInput input, CancellationToken cancellationToken = default)
{
return await _auditLogAppService.GetPageListAsync(input, cancellationToken);
}
[HttpPost]
[Route("detail/{id}")]
[SwaggerOperation(summary: "通过审计日志Id查找审计日志详情", Tags = new[] { "Auditlogs" })]
public async Task<AuditLogOutput> GetAsync(Guid id, CancellationToken cancellationToken = default)
{
return await _auditLogAppService.GetAsync(id, cancellationToken);
}
[HttpPost]
[Route("page-entity-changes")]
[SwaggerOperation(summary: "查询实体变化", Tags = new[] { "Auditlogs" })]
public async Task<ListResultDto<EntityChangeOutput>> GetEntityChangePageListAsync(GetEntityChangesInput input, CancellationToken cancellationToken = default)
{
return await _auditLogAppService.GetEntityChangePageListAsync(input, cancellationToken);
}
}
}

18
aspnet-core/modules/AuditLoggingManagement/src/Lion.AbpPro.AuditLoggingManagement.HttpApi/Lion.AbpPro.AuditLoggingManagement.HttpApi.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../../../common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Lion.AbpPro.AuditLoggingManagement</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.2.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(AbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lion.AbpPro.AuditLoggingManagement.Application.Contracts\Lion.AbpPro.AuditLoggingManagement.Application.Contracts.csproj" />
</ItemGroup>
</Project>

23
aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.Application.Tests/Lion.AbpPro.AuditLoggingManagement.Application.Tests.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

13
aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.Application.Tests/UnitTest1.cs

@ -0,0 +1,13 @@
using Xunit;
namespace Lion.AbpPro.AuditLoggingManagement.Application.Tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}
}

23
aspnet-core/modules/AuditLoggingManagement/test/Lion.AbpPro.AuditLoggingManagement.TestBase/Lion.AbpPro.AuditLoggingManagement.TestBase.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
Loading…
Cancel
Save