Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public async Task <IPagedResult <AuditLogOutputPageDto> > GetAuditLogPageAsync(PageRequest request)
        {
            var exp = MongoDBFilterBuilder.GetExpression <AuditLog>(request.Filter);

            OrderCondition <AuditLog>[] orderConditions = new OrderCondition <AuditLog>[] { new OrderCondition <AuditLog>(o => o.CreatedTime, DestinyCore.Enums.SortDirection.Descending) };
            request.OrderConditions = orderConditions;
            //_auditLogRepository.Collection.Find(o=>o.FunctionName.Contains("dd"))
            var page = await _auditLogRepository.Collection.ToPageAsync(exp, request, x => new AuditLogOutputPageDto
            {
                BrowserInformation = x.BrowserInformation,
                Ip                = x.Ip,
                FunctionName      = x.FunctionName,
                Action            = x.Action,
                ExecutionDuration = x.ExecutionDuration,
                CreatedTime       = x.CreatedTime,
                Id                = x.Id,
                OperationType     = x.OperationType,
                Message           = x.Message,
                UserId            = x.UserId,
                NickName          = x.NickName,
                UserName          = x.UserName
            });

            return(page);
        }
Esempio n. 2
0
        /// <summary>
        /// 分页获取数据实体属性审计
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <IPagedResult <AuditPropertyEntryOutputPageDto> > GetAuditEntryPropertyPageAsync(PageRequest request)
        {
            var exp = MongoDBFilterBuilder.GetExpression <AuditPropertysEntry>(request.Filter);

            var page = await _auditPropertysEntryRepository.Collection.ToPageAsync(exp, request, x => new AuditPropertyEntryOutputPageDto
            {
                Id = x.Id,
                PropertieDisplayName = x.PropertieDisplayName,
                NewValues            = x.NewValues,
                OriginalValues       = x.OriginalValues,
                Properties           = x.Properties,
                PropertiesType       = x.PropertiesType,
            });

            return(page);
        }
Esempio n. 3
0
        /// <summary>
        /// 分页获取数据实体审计
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        public async Task <IPagedResult <AuditEntryOutputPageDto> > GetAuditEntryPageAsync(PageRequest request)
        {
            var exp = MongoDBFilterBuilder.GetExpression <AuditEntry>(request.Filter);

            OrderCondition <AuditEntry>[] orderConditions = new OrderCondition <AuditEntry>[] { new OrderCondition <AuditEntry>(o => o.CreatedTime, DestinyCore.Enums.SortDirection.Descending) };
            request.OrderConditions = orderConditions;
            var page = await _auditEntryRepository.Collection.ToPageAsync(exp, request, x => new AuditEntryOutputPageDto
            {
                Id                = x.Id,
                EntityAllName     = x.EntityAllName,
                EntityDisplayName = x.EntityDisplayName,
                KeyValues         = x.KeyValues,
                OperationType     = x.OperationType,
                CreatedTime       = x.CreatedTime,
                NickName          = x.NickName,
                UserName          = x.UserName,
            });

            return(page);
        }