Merge branch 'framework' of https://gitee.com/ccnetcore/Yi into framework

This commit is contained in:
陈淳
2023-02-22 17:03:50 +08:00
6 changed files with 29 additions and 16 deletions

View File

@@ -9,15 +9,7 @@ namespace Yi.Framework.OperLog
{
public class OperationLogGetListInputVo : PagedAllResultRequestDto
{
public string? Title { get; set; }
public OperEnum OperType { get; set; }
public string? RequestMethod { get; set; }
public OperEnum? OperType { get; set; }
public string? OperUser { get; set; }
public string? OperIp { get; set; }
public string? OperLocation { get; set; }
public string? Method { get; set; }
public string? RequestParam { get; set; }
public string? RequestResult { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -12,9 +12,23 @@ namespace Yi.Framework.OperLog
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo>,
IOperationLogService, IAutoApiService
{
public override Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
public override async Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
{
return base.GetListAsync(input);
var entity = await MapToEntityAsync(input);
RefAsync<int> total = 0;
var entities = await _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.PageNum, input.PageSize, total);
return new PagedResultDto<OperationLogGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
[NonAction]
public override Task<OperationLogGetListOutputDto> UpdateAsync(long id, OperationLogGetListOutputDto input)
{
return base.UpdateAsync(id, input);
}
}
}