diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/LoginLogService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/LoginLogService.cs new file mode 100644 index 00000000..95c09dc6 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/LoginLogService.cs @@ -0,0 +1,37 @@ +using SqlSugar; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Yi.Framework.Ddd.Application; +using Yi.Framework.Rbac.Application.Contracts.Dtos.LoginLog; +using Yi.Framework.Rbac.Domain.Entities; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.Rbac.Application.Services.RecordLog +{ + public class LoginLogService : YiCrudAppService + { + private readonly ISqlSugarRepository _repository; + public LoginLogService(ISqlSugarRepository repository) : base(repository) + { + _repository = repository; + } + + public override async Task> GetListAsync(LoginLogGetListInputVo input) + { + RefAsync total = 0; + + var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.LoginIp), x => x.LoginIp.Contains(input.LoginIp!)) + .WhereIF(!string.IsNullOrEmpty(input.LoginUser), x => x.LoginUser!.Contains(input.LoginUser!)) + .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime) + .ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + return new PagedResultDto(total, await MapToGetListOutputDtosAsync(entities)); + } + + [RemoteService(false)] + public override Task UpdateAsync(Guid id, LoginLogGetListOutputDto input) + { + return base.UpdateAsync(id, input); + } + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/OperationLogService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/OperationLogService.cs new file mode 100644 index 00000000..3bcd6d37 --- /dev/null +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/RecordLog/OperationLogService.cs @@ -0,0 +1,40 @@ +using SqlSugar; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Yi.Framework.Ddd.Application; +using Yi.Framework.Rbac.Application.Contracts.Dtos.OperLog; +using Yi.Framework.Rbac.Application.Contracts.IServices; +using Yi.Framework.Rbac.Domain.Operlog; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.Rbac.Application.Services.RecordLog +{ + /// + /// OperationLog服务实现 + /// + public class OperationLogService : YiCrudAppService, + IOperationLogService + { + private ISqlSugarRepository _repository; + public OperationLogService(ISqlSugarRepository repository) : base(repository) + { + _repository = repository; + } + + public override async Task> GetListAsync(OperationLogGetListInputVo input) + { + RefAsync total = 0; + var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.OperUser), x => x.OperUser.Contains(input.OperUser!)) + .WhereIF(input.OperType is not null, x => x.OperType == input.OperType) + .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime) + .ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + return new PagedResultDto(total, await MapToGetListOutputDtosAsync(entities)); + } + + [RemoteService(false)] + public override Task UpdateAsync(Guid id, OperationLogGetListOutputDto input) + { + return base.UpdateAsync(id, input); + } + } +}