добавлен метод для получения всех писем клиента в контроллере клиента в рест апи
This commit is contained in:
parent
d596f13d2c
commit
1c676ba332
@ -12,11 +12,12 @@ namespace SushiBarRestApi.Controllers
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IClientLogic _logic;
|
||||
public ClientController(IClientLogic logic, ILogger<ClientController>
|
||||
logger)
|
||||
private readonly IMessageInfoLogic messageLogic;
|
||||
public ClientController(IClientLogic logic, ILogger<ClientController> logger, IMessageInfoLogic messageLogic)
|
||||
{
|
||||
_logger = logger;
|
||||
_logic = logic;
|
||||
this.messageLogic = messageLogic;
|
||||
}
|
||||
[HttpGet]
|
||||
public ClientViewModel? Login(string login, string password)
|
||||
@ -61,5 +62,22 @@ namespace SushiBarRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public List<MessageInfoViewModel>? GetMessages(int clientId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return messageLogic.ReadList(new MessageInfoSearchModel
|
||||
{
|
||||
ClientId = clientId
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка получения писем клиента");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user