mirror of https://github.com/abpframework/abp.git
11 changed files with 202 additions and 0 deletions
@ -0,0 +1,21 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<Import Project="..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<AssemblyName>Volo.Abp.Auditing</AssemblyName> |
||||
|
<PackageId>Volo.Abp.Auditing</PackageId> |
||||
|
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
||||
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
||||
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
||||
|
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" /> |
||||
|
<ProjectReference Include="..\Volo.Abp.Data\Volo.Abp.Data.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,15 @@ |
|||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.Data; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
[DependsOn(typeof(AbpDataModule))] //TODO: Can we remove data module dependency since it only contains ISoftDelete related to auditing module!
|
||||
|
public class AbpAuditingModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
services.AddAssemblyOf<AbpAuditingModule>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// This interface can be implemented to add standard auditing properties to a class.
|
||||
|
/// </summary>
|
||||
|
public interface IAudited : ICreationAudited, IModificationAudited |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Extends <see cref="IAudited"/> to add user navigation properties.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TUser">Type of the user</typeparam>
|
||||
|
public interface IAudited<TUser> : IAudited, ICreationAudited<TUser>, IModificationAudited<TUser> |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// This interface can be implemented to store creation information (who and when created).
|
||||
|
/// </summary>
|
||||
|
public interface ICreationAudited : IHasCreationTime |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Id of the creator user.
|
||||
|
/// </summary>
|
||||
|
long? CreatorUserId { get; set; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Adds navigation properties to <see cref="ICreationAudited"/> interface for user.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TUser">Type of the user</typeparam>
|
||||
|
public interface ICreationAudited<TUser> : ICreationAudited |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Reference to the creator user.
|
||||
|
/// </summary>
|
||||
|
TUser CreatorUser { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// This interface can be implemented to store deletion information (who delete and when deleted).
|
||||
|
/// </summary>
|
||||
|
public interface IDeletionAudited : IHasDeletionTime |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Id of the deleter user.
|
||||
|
/// </summary>
|
||||
|
long? DeleterUserId { get; set; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Extends <see cref="IDeletionAudited"/> to add user navigation propery.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TUser">Type of the user</typeparam>
|
||||
|
public interface IDeletionAudited<TUser> : IDeletionAudited |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Reference to the deleter user.
|
||||
|
/// </summary>
|
||||
|
TUser DeleterUser { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// This interface adds <see cref="IDeletionAudited"/> to <see cref="IAudited"/>.
|
||||
|
/// </summary>
|
||||
|
public interface IFullAudited : IAudited, IDeletionAudited |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Adds user navigation properties to <see cref="IFullAudited"/> interface for user.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TUser">Type of the user</typeparam>
|
||||
|
public interface IFullAudited<TUser> : IAudited<TUser>, IFullAudited, IDeletionAudited<TUser> |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// A standard interface to add CreationTime property.
|
||||
|
/// </summary>
|
||||
|
public interface IHasCreationTime |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Creation time.
|
||||
|
/// </summary>
|
||||
|
DateTime CreationTime { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// A standard interface to add DeletionTime property to a class.
|
||||
|
/// It also makes the class soft delete (see <see cref="ISoftDelete"/>).
|
||||
|
/// </summary>
|
||||
|
public interface IHasDeletionTime : ISoftDelete |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Deletion time.
|
||||
|
/// </summary>
|
||||
|
DateTime? DeletionTime { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// A standard interface to add DeletionTime property to a class.
|
||||
|
/// </summary>
|
||||
|
public interface IHasModificationTime |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// The last modified time for this entity.
|
||||
|
/// </summary>
|
||||
|
DateTime? LastModificationTime { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
namespace Volo.Abp.Auditing |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// This interface can be implemented to store modification information (who and when modified lastly).
|
||||
|
/// </summary>
|
||||
|
public interface IModificationAudited : IHasModificationTime |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Last modifier user for this entity.
|
||||
|
/// </summary>
|
||||
|
long? LastModifierUserId { get; set; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Adds navigation properties to <see cref="IModificationAudited"/> interface for a user.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TUser">Type of the user</typeparam>
|
||||
|
public interface IModificationAudited<TUser> : IModificationAudited |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Reference to the last modifier user of this entity.
|
||||
|
/// </summary>
|
||||
|
TUser LastModifierUser { get; set; } |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue