Adding
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Models.Responses
|
||||
{
|
||||
public class FactoidResponse
|
||||
{
|
||||
public string CumulativeValue { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string FontAwesomeIcon { get; set; }
|
||||
public IReadOnlyCollection<RepoAccount> Records { get; set; }
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LCU.API.Collections.RepoApi.Models.Filters;
|
||||
using LCU.Shared.Collections.RepoApiLib.Models.Results;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Models.Responses
|
||||
{
|
||||
public class PagedResponse<T> where T : class
|
||||
{
|
||||
public PagedResponse() { }
|
||||
|
||||
public PagedResponse(PagedResult<T> pagedResult, PageFilter filter, IUrlHelper url, HttpRequest request, string uriAction = "Get")
|
||||
{
|
||||
TotalItems = pagedResult.Total;
|
||||
Items = pagedResult.Items;
|
||||
CurrentPage = filter.Page;
|
||||
TotalPages = pagedResult.Total == 0 ? 1 : (int) Math.Ceiling((decimal) pagedResult.Total / filter.Limit);
|
||||
|
||||
PageFilter newFilter = filter.Clone() as PageFilter;
|
||||
if (pagedResult.Total > (filter.Page * filter.Limit))
|
||||
{
|
||||
newFilter.Page = filter.Page + 1;
|
||||
NextPage = new Uri(url.Action(uriAction, null, newFilter, request.Scheme));
|
||||
}
|
||||
|
||||
if (filter.Page > 1)
|
||||
{
|
||||
newFilter.Page = filter.Page - 1;
|
||||
PreviousPage = new Uri(url.Action(uriAction, null, newFilter, request.Scheme));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<T> Items { get; set; }
|
||||
public Uri NextPage { get; set; }
|
||||
public Uri PreviousPage { get; set; }
|
||||
public int TotalItems { get; set; }
|
||||
public int CurrentPage { get; set; }
|
||||
public int TotalPages { get; set; }
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
using LCU.Shared.Collections.RepoApiLib.Models;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Models.Responses
|
||||
{
|
||||
public class RepoCompanySelectionPostResponse
|
||||
{
|
||||
public RepoCompanySelection PreviousRepoCompanySelection {get; set;}
|
||||
public RepoCompanySelection NewRepoCompanySelection { get; set; }
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using LCU.Shared.Collections.RepoApiLib.Models;
|
||||
|
||||
namespace LCU.API.Collections.RepoApi.Models.Responses
|
||||
{
|
||||
public class VehicleFloorPricingParametersPutResponse
|
||||
{
|
||||
public VehicleFloorPricingParameters[] vehicleFloorPricingParameters;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user