Commit 9cba4934 by Neo Turing

优化

parent 66377839
...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; ...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.6190")] [assembly: AssemblyVersion("5.4.2024.7160")]
[assembly: AssemblyFileVersion("5.4.2023.6190")] [assembly: AssemblyFileVersion("5.4.2023.7160")]
\ No newline at end of file \ No newline at end of file
...@@ -25,7 +25,7 @@ namespace Kivii.EmailPools.Transforms ...@@ -25,7 +25,7 @@ namespace Kivii.EmailPools.Transforms
if (Items.IsNullOrEmpty()) Items = new List<EmailPool>(); if (Items.IsNullOrEmpty()) Items = new List<EmailPool>();
if (Item != null) Items.Add(Item); if (Item != null) Items.Add(Item);
Console.WriteLine("-----------------------EmailCreateStart---------------------------------");
var conn = KiviiContext.GetOpenedDbConnection<EmailPool<G>>(); var conn = KiviiContext.GetOpenedDbConnection<EmailPool<G>>();
var rtns = new RestfulCreateResponse<EmailPool<G>>(); var rtns = new RestfulCreateResponse<EmailPool<G>>();
rtns.Results = new List<EmailPool<G>>(); rtns.Results = new List<EmailPool<G>>();
...@@ -34,25 +34,30 @@ namespace Kivii.EmailPools.Transforms ...@@ -34,25 +34,30 @@ namespace Kivii.EmailPools.Transforms
{ {
try try
{ {
//try
//{
// Console.WriteLine($"-----------------------from:{item.FromAddress}---------------------------------");
// var from = new MailAddress(item.FromAddress, item.FromAddress);
//}
//catch
//{
// Console.WriteLine($"-----------------------fromCatch:{item.FromAddress}---------------------------------");
// throw new Exception($"发送地址{item.FromAddress},格式错误");
//}
try try
{ {
var from = new MailAddress(item.FromAddress, item.FromAddress); Console.WriteLine($"-----------------------To:{item.ToAddress}---------------------------------");
}
catch
{
throw new Exception($"发送地址{item.FromAddress},格式错误");
}
try
{
var to = new MailAddress(item.ToAddress, item.ToName); var to = new MailAddress(item.ToAddress, item.ToName);
} }
catch catch
{ {
Console.WriteLine($"-----------------------ToCatch:{item.ToAddress}---------------------------------");
throw new Exception($"收件地址{item.ToAddress},格式错误"); throw new Exception($"收件地址{item.ToAddress},格式错误");
} }
EmailPool<G> emailPool = new EmailPool<G>(); EmailPool<G> emailPool = new EmailPool<G>();
emailPool.PopulateWith(item); emailPool.PopulateWith(item);
conn.Insert(emailPool); conn.Insert(emailPool);
Console.WriteLine("-----------------------EmailCreateEnd---------------------------------");
rtns.Results.Add(emailPool); rtns.Results.Add(emailPool);
} }
catch catch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment