Add configs and MessageInfo
This commit is contained in:
parent
90526748c5
commit
d075650fc4
11
SushiBar/SushiBar/App.config
Normal file
11
SushiBar/SushiBar/App.config
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="SmtpClientHost" value="smtp.gmail.com" />
|
||||
<add key="SmtpClientPort" value="587" />
|
||||
<add key="PopHost" value="pop.gmail.com" />
|
||||
<add key="PopPort" value="995" />
|
||||
<add key="MailLogin" value="labwork15kafis@gmail.com" />
|
||||
<add key="MailPassword" value="passlab15" />
|
||||
</appSettings>
|
||||
</configuration>
|
@ -0,0 +1,14 @@
|
||||
using SushiBarDataModels.Models;
|
||||
|
||||
namespace SushiBarContracts.BindingModels;
|
||||
|
||||
public class MessageInfoBindingModel : IMessageInfoModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
public int? ClientId { get; set; }
|
||||
public string SenderName { get; set; } = string.Empty;
|
||||
public DateTime DateDelivery { get; set; }
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
public string Body { get; set; } = string.Empty;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SushiBarContracts.BindingModels;
|
||||
using SushiBarContracts.SearchModels;
|
||||
using SushiBarContracts.ViewModels;
|
||||
|
||||
namespace SushiBarContracts.BusinessLogicsContracts;
|
||||
|
||||
public interface IMessageInfoLogic
|
||||
{
|
||||
List<MessageInfoViewModel>? ReadList(MessageInfoSearchModel? model);
|
||||
MessageInfoViewModel? ReadElement(MessageInfoSearchModel model);
|
||||
bool Create(MessageInfoBindingModel model);
|
||||
bool Update(MessageInfoBindingModel model);
|
||||
bool Delete(MessageInfoBindingModel model);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace SushiBarContracts.SearchModels;
|
||||
|
||||
public class MessageInfoSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? ClientId { get; set; }
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using SushiBarContracts.BindingModels;
|
||||
using SushiBarContracts.SearchModels;
|
||||
using SushiBarContracts.ViewModels;
|
||||
|
||||
namespace SushiBarContracts.StoragesContracts;
|
||||
|
||||
public interface IMessageInfoStorage
|
||||
{
|
||||
List<MessageInfoViewModel> GetFullList();
|
||||
List<MessageInfoViewModel> GetFilteredList(MessageInfoSearchModel? model);
|
||||
MessageInfoViewModel? GetElement(MessageInfoSearchModel model);
|
||||
MessageInfoViewModel? Insert(MessageInfoBindingModel model);
|
||||
MessageInfoViewModel? Update(MessageInfoBindingModel model);
|
||||
MessageInfoViewModel? Delete(MessageInfoBindingModel model);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System.ComponentModel;
|
||||
using SushiBarDataModels.Models;
|
||||
|
||||
namespace SushiBarContracts.ViewModels;
|
||||
|
||||
public class MessageInfoViewModel : IMessageInfoModel
|
||||
{
|
||||
public int Id { get; }
|
||||
public string MessageId { get; }
|
||||
public int? ClientId { get; }
|
||||
[DisplayName("Sender name")]
|
||||
public string SenderName { get; }
|
||||
[DisplayName("Date delivery")]
|
||||
public DateTime DateDelivery { get; }
|
||||
public string Subject { get; }
|
||||
public string Body { get; }
|
||||
}
|
11
SushiBar/SushiBarModels/Models/IMessageInfoModel.cs
Normal file
11
SushiBar/SushiBarModels/Models/IMessageInfoModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace SushiBarDataModels.Models;
|
||||
|
||||
public interface IMessageInfoModel : IId
|
||||
{
|
||||
string MessageId { get; }
|
||||
int? ClientId { get; }
|
||||
string SenderName { get; }
|
||||
DateTime DateDelivery { get; }
|
||||
string Subject { get; }
|
||||
string Body { get; }
|
||||
}
|
@ -47,7 +47,7 @@ public class ImplementerController : Controller
|
||||
{
|
||||
return _order.ReadList(new OrderSearchModel
|
||||
{
|
||||
Status = OrderStatus.Accepted
|
||||
Status = new List<OrderStatus>() { OrderStatus.Accepted }
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -5,5 +5,11 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"SmtpClientHost": "smtp.gmail.com",
|
||||
"SmtpClientPort": "587",
|
||||
"PopHost": "pop.gmail.com",
|
||||
"PopPort": "995",
|
||||
"MailLogin": "labwork15kafis@gmail.com",
|
||||
"MailPassword": "passlab15"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user