forked from jerrytang67/SoMall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aab2beb
commit 3cab308
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../modules/TT.Abp.Audit/TT/Abp/AuditManagement/Audits/OrganizationUnitAuditValueProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Microsoft.EntityFrameworkCore; | ||
using TT.Abp.AuditManagement.Domain; | ||
using Volo.Abp.Domain.Repositories; | ||
using Volo.Abp.Uow; | ||
|
||
namespace TT.Abp.AuditManagement.Audits | ||
{ | ||
public class OrganizationUnitAuditValueProvider : AuditValueProvider | ||
{ | ||
public const string ProviderName = "O"; | ||
|
||
public override string Name => ProviderName; | ||
|
||
public OrganizationUnitAuditValueProvider( | ||
IRepository<AuditFlow, Guid> auditFlowRepository | ||
) : base(auditFlowRepository) | ||
{ | ||
} | ||
|
||
[UnitOfWork] | ||
public override async Task<Guid?> GetOrNullAsync(AuditDefinition audit) | ||
{ | ||
var dbEntity = await AuditFlowRepository | ||
.FirstOrDefaultAsync( | ||
x => x.ProviderName == ProviderName | ||
&& x.AuditName == audit.Name | ||
&& x.Enable | ||
&& x.ProviderKey == "ouId" | ||
); | ||
|
||
return dbEntity?.Id; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters