Compare commits
No commits in common. "5a9ee9e6b624b2b6576bf5e597905887175b8321" and "d853579a48b998091f2bac554564160bc41633cd" have entirely different histories.
5a9ee9e6b6
...
d853579a48
@ -35,7 +35,7 @@ namespace BankBusinessLogic.BusinessLogic
|
||||
_logger.LogInformation("ReadList Count: {Count}", list.Count);
|
||||
return list;
|
||||
}
|
||||
public List<int> ReadListByRequestId(CardSearchModel model)
|
||||
public List<CardViewModel>? ReadListByRequestId(CardSearchModel model)
|
||||
{
|
||||
_logger.LogInformation("ReadListByRequestId. Number: {Number}, Id: {Id}", model?.Number, model?.Id);
|
||||
var list = _cardStorage.GetListForRequest(model);
|
||||
|
@ -186,13 +186,13 @@ namespace BankClientApp.Controllers
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<int> GetCards(int requestId)
|
||||
public List<CardViewModel>? GetCards(int requestId)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
var result = APIClient.GetRequest<List<int>>($"api/card/getcards?requestid={requestId}");
|
||||
var result = APIClient.GetRequest<List<CardViewModel>>($"api/card/getcards?requestid={requestId}");
|
||||
if (result == null)
|
||||
{
|
||||
return default;
|
||||
|
@ -13,7 +13,6 @@ namespace BankContracts.BusinessLogicsContracts
|
||||
{
|
||||
List<CardViewModel>? ReadList(CardSearchModel? model);
|
||||
CardViewModel? ReadElement(CardSearchModel model);
|
||||
List<int> ReadListByRequestId(CardSearchModel model);
|
||||
bool Create(CardBindingModel model);
|
||||
bool Update(CardBindingModel model);
|
||||
bool Delete(CardBindingModel model);
|
||||
|
@ -13,7 +13,7 @@ namespace BankContracts.StoragesContracts
|
||||
{
|
||||
List<CardViewModel> GetFullList();
|
||||
List<CardViewModel> GetFilteredList(CardSearchModel model);
|
||||
List<int> GetListForRequest(CardSearchModel model);
|
||||
List<CardViewModel> GetListForRequest(CardSearchModel model);
|
||||
List<ReportTransfersViewModel> GetReportTransfersList(CardSearchModel model);
|
||||
List<ReportOperationsRequestsViewModel> GetReportOperationsRequestsList(CardSearchModel model);
|
||||
CardViewModel? GetElement(CardSearchModel model);
|
||||
|
@ -30,13 +30,13 @@ namespace BankDatabaseImplement.Implements
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<int> GetListForRequest(CardSearchModel model)
|
||||
public List<CardViewModel> GetListForRequest(CardSearchModel model)
|
||||
{
|
||||
using var context = new BankDatabase();
|
||||
return context.CardRequests
|
||||
.Include(x => x.Card).Include(x => x.Request)
|
||||
.Where(x => x.RequestId==model.RequestId)
|
||||
.Select(x => x.Card.Id).ToList();
|
||||
.Select(x => x.Card.GetViewModel).ToList();
|
||||
}
|
||||
|
||||
public List<ReportTransfersViewModel> GetReportTransfersList(CardSearchModel model)
|
||||
|
@ -36,12 +36,12 @@ namespace BankRestApi.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<int> GetCards(int requestId)
|
||||
[HttpPost]
|
||||
public List<CardViewModel>? GetCards(int requestId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _logic.ReadListByRequestId(new CardSearchModel
|
||||
return _logic.ReadList(new CardSearchModel
|
||||
{
|
||||
RequestId = requestId,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user