コード例 #1
0
        public async Task <HistoryResponseModel> GetHistory([FromRoute] string nodeId, [FromQuery] SimpleQueryParams queryParams)
        {
            if (queryParams.SkipCount < 0)
            {
                queryParams.SkipCount = 0;
            }
            if (queryParams.MaxItems < 0 || queryParams.MaxItems > 100)
            {
                queryParams.MaxItems = 100;
            }

            var history = await _auditLogService.GetEvents(new TransactionHistoryQuery
            {
                NodeId      = nodeId,
                CurrentPage = queryParams.SkipCount + 1,
                PageSize    = queryParams.MaxItems
            });

            return(new HistoryResponseModel
            {
                List = new HistoryListModel
                {
                    Pagination = new Pagination
                    {
                        Count = history.PageCount,
                        HasMoreItems = history.CurrentPage < history.PageCount,
                        TotalItems = history.RecordCount,
                        SkipCount = queryParams.SkipCount,
                        MaxItems = queryParams.MaxItems
                    },
                    Entries = history.Results.ToList().Select(x => new TransactionHistoryEntry {
                        Entry = x
                    })
                }
            });
        }
コード例 #2
0
 public async Task <CommentPagingFixed> GetComments([FromRoute] string nodeId, [FromQuery] SimpleQueryParams queryParams)
 {
     return(await _alfrescoHttpClient.GetComments(nodeId, ImmutableList <Parameter> .Empty.AddQueryParams(queryParams)));
 }