代码修改
parent
ca679057c4
commit
c77b3d74c8
|
|
@ -34,7 +34,7 @@ public static class ServiceCollectionSetup
|
||||||
|
|
||||||
services.Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
services.Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
||||||
|
|
||||||
//转发头设置 获取真实IP
|
//ת<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȡ<EFBFBD><C8A1>ʵIP
|
||||||
services.Configure<ForwardedHeadersOptions>(options =>
|
services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
{
|
{
|
||||||
options.ForwardedHeaders =
|
options.ForwardedHeaders =
|
||||||
|
|
@ -52,7 +52,7 @@ public static class ServiceCollectionSetup
|
||||||
|
|
||||||
services.AddScoped<IObtainTaskAutoCancelJob, ObtainTaskAutoCancelJob>();
|
services.AddScoped<IObtainTaskAutoCancelJob, ObtainTaskAutoCancelJob>();
|
||||||
|
|
||||||
// 注册以Service 结尾的服务
|
// ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Service <20><>β<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
|
||||||
services.Scan(scan => scan
|
services.Scan(scan => scan
|
||||||
.FromAssemblies(typeof(BaseService).Assembly)
|
.FromAssemblies(typeof(BaseService).Assembly)
|
||||||
.AddClasses(classes => classes.Where(t => t.Name.Contains("Service")))
|
.AddClasses(classes => classes.Where(t => t.Name.Contains("Service")))
|
||||||
|
|
@ -71,23 +71,23 @@ public static class ServiceCollectionSetup
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
// MediatR <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <20>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD> <20>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD> ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>handler<65><72>Ӧ<EFBFBD><D3A6>ϵ
|
||||||
//builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
//builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 历史废弃配置
|
#region <EFBFBD><EFBFBD>ʷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
//builder.Services.AddMemoryCache();
|
//builder.Services.AddMemoryCache();
|
||||||
////上传限制 配置
|
////<EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
//builder.Services.Configure<FormOptions>(options =>
|
//builder.Services.Configure<FormOptions>(options =>
|
||||||
//{
|
//{
|
||||||
// options.MultipartBodyLengthLimit = int.MaxValue;
|
// options.MultipartBodyLengthLimit = int.MaxValue;
|
||||||
// options.ValueCountLimit = int.MaxValue;
|
// options.ValueCountLimit = int.MaxValue;
|
||||||
// options.ValueLengthLimit = int.MaxValue;
|
// options.ValueLengthLimit = int.MaxValue;
|
||||||
//});
|
//});
|
||||||
//IP 限流 可设置白名单 或者黑名单
|
//IP <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD><EFBFBD>
|
||||||
//services.AddIpPolicyRateLimitSetup(_configuration);
|
//services.AddIpPolicyRateLimitSetup(_configuration);
|
||||||
// 用户类型 策略授权
|
// <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ
|
||||||
//services.AddAuthorizationPolicySetup(_configuration);
|
//services.AddAuthorizationPolicySetup(_configuration);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
@ -95,25 +95,25 @@ public static class ServiceCollectionSetup
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Autofac 废弃
|
#region Autofac <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
//public class AutofacModuleSetup : Autofac.Module
|
//public class AutofacModuleSetup : Autofac.Module
|
||||||
//{
|
//{
|
||||||
// protected override void Load(ContainerBuilder containerBuilder)
|
// protected override void Load(ContainerBuilder containerBuilder)
|
||||||
// {
|
// {
|
||||||
|
|
||||||
// #region byzhouhang 20210917 此处注册泛型仓储 可以减少Domain层 和Infra.EFcore 两层 空的仓储接口定义和 仓储文件定义
|
// #region byzhouhang 20210917 <EFBFBD>˴<EFBFBD>ע<EFBFBD>᷺<EFBFBD>Ͳִ<EFBFBD> <20><><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Domain<69><6E> <20><>Infra.EFcore <20><><EFBFBD><EFBFBD> <20>յIJִ<C4B2><D6B4>ӿڶ<D3BF><DAB6><EFBFBD><EFBFBD> <20>ִ<EFBFBD><D6B4>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
// containerBuilder.RegisterGeneric(typeof(Repository<>))
|
// containerBuilder.RegisterGeneric(typeof(Repository<>))
|
||||||
// .As(typeof(IRepository<>)).InstancePerLifetimeScope();//注册泛型仓储
|
// .As(typeof(IRepository<>)).InstancePerLifetimeScope();//ע<EFBFBD>᷺<EFBFBD>Ͳִ<EFBFBD>
|
||||||
|
|
||||||
// containerBuilder.RegisterType<Repository>().As<IRepository>().InstancePerLifetimeScope();
|
// containerBuilder.RegisterType<Repository>().As<IRepository>().InstancePerLifetimeScope();
|
||||||
|
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region 指定控制器也由autofac 来进行实例获取 https://www.cnblogs.com/xwhqwer/p/15320838.html
|
// #region ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD>autofac <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ȡ https://www.cnblogs.com/xwhqwer/p/15320838.html
|
||||||
|
|
||||||
// //获取所有控制器类型并使用属性注入
|
// //<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>
|
||||||
// containerBuilder.RegisterAssemblyTypes(typeof(BaseService).Assembly)
|
// containerBuilder.RegisterAssemblyTypes(typeof(BaseService).Assembly)
|
||||||
// .Where(type => typeof(IDynamicWebApi).IsAssignableFrom(type))
|
// .Where(type => typeof(IDynamicWebApi).IsAssignableFrom(type))
|
||||||
// .PropertiesAutowired();
|
// .PropertiesAutowired();
|
||||||
|
|
@ -129,7 +129,7 @@ public static class ServiceCollectionSetup
|
||||||
// //containerBuilder.RegisterType<UserInfo>().As<IUserInfo>().InstancePerLifetimeScope();
|
// //containerBuilder.RegisterType<UserInfo>().As<IUserInfo>().InstancePerLifetimeScope();
|
||||||
|
|
||||||
|
|
||||||
// //注册hangfire任务 依赖注入
|
// //ע<EFBFBD><EFBFBD>hangfire<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||||
// containerBuilder.RegisterType<ObtainTaskAutoCancelJob>().As<IObtainTaskAutoCancelJob>().InstancePerDependency();
|
// containerBuilder.RegisterType<ObtainTaskAutoCancelJob>().As<IObtainTaskAutoCancelJob>().InstancePerDependency();
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -981,6 +981,57 @@
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:System.Exception"></exception>
|
<exception cref="T:System.Exception"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:IRaCIS.Core.Application.Service.EmailLogService">
|
||||||
|
<summary>
|
||||||
|
邮件日志
|
||||||
|
</summary>
|
||||||
|
<param name="_emailLogRepository"></param>
|
||||||
|
<param name="systemEmailConfig"></param>
|
||||||
|
<param name="_mapper"></param>
|
||||||
|
<param name="_userInfo"></param>
|
||||||
|
<param name="_localizer"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.EmailLogService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailLog},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
|
<summary>
|
||||||
|
邮件日志
|
||||||
|
</summary>
|
||||||
|
<param name="_emailLogRepository"></param>
|
||||||
|
<param name="systemEmailConfig"></param>
|
||||||
|
<param name="_mapper"></param>
|
||||||
|
<param name="_userInfo"></param>
|
||||||
|
<param name="_localizer"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.EmailLogService.BuildSearchQuery(IRaCIS.Core.Application.ViewModel.EmailLogQuery)">
|
||||||
|
<summary>
|
||||||
|
邮件筛选条件构建
|
||||||
|
</summary>
|
||||||
|
<param name="query"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.EmailLogService.GetEmailsWithSorting(MailKit.IMailFolder,System.Collections.Generic.IList{MailKit.UniqueId})">
|
||||||
|
<summary>
|
||||||
|
邮件排序处理
|
||||||
|
</summary>
|
||||||
|
<param name="sentFolder"></param>
|
||||||
|
<param name="uids"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.EmailLogService.ConvertToEmailLogView(MailKit.UniqueId,MimeKit.MimeMessage)">
|
||||||
|
<summary>
|
||||||
|
获取完整的邮件信息
|
||||||
|
</summary>
|
||||||
|
<param name="uid"></param>
|
||||||
|
<param name="message"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.EmailLogService.ApplyMemoryFilters(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.EmailLogView},IRaCIS.Core.Application.ViewModel.EmailLogQuery)">
|
||||||
|
<summary>
|
||||||
|
应用内存中的过滤条件(对于无法通过IMAP搜索的条件)
|
||||||
|
</summary>
|
||||||
|
<param name="emails"></param>
|
||||||
|
<param name="query"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.EventStoreRecordService.GetEventStoreRecordList(IRaCIS.Core.Application.ViewModel.EventStoreRecordQuery)">
|
<member name="M:IRaCIS.Core.Application.Service.EventStoreRecordService.GetEventStoreRecordList(IRaCIS.Core.Application.ViewModel.EventStoreRecordQuery)">
|
||||||
<summary>
|
<summary>
|
||||||
邮件事件消息列表
|
邮件事件消息列表
|
||||||
|
|
@ -15260,6 +15311,66 @@
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.CommonDocumentAddOrEdit">
|
<member name="T:IRaCIS.Core.Application.ViewModel.CommonDocumentAddOrEdit">
|
||||||
<summary> CommonDocumentAddOrEdit 列表查询参数模型</summary>
|
<summary> CommonDocumentAddOrEdit 列表查询参数模型</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.MessageId">
|
||||||
|
<summary>
|
||||||
|
邮件Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.UniqueId">
|
||||||
|
<summary>
|
||||||
|
唯一Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.EmailSubject">
|
||||||
|
<summary>
|
||||||
|
邮件主题
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.ToRecipients">
|
||||||
|
<summary>
|
||||||
|
收件人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.CcRecipients">
|
||||||
|
<summary>
|
||||||
|
抄送人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.Attachments">
|
||||||
|
<summary>
|
||||||
|
附件
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.EmailDate">
|
||||||
|
<summary>
|
||||||
|
日期
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.ErrorInfo">
|
||||||
|
<summary>
|
||||||
|
错误信息
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.SenderAddress">
|
||||||
|
<summary>
|
||||||
|
发件人地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.SenderName">
|
||||||
|
<summary>
|
||||||
|
发件人姓名
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.Content">
|
||||||
|
<summary>
|
||||||
|
邮件内容
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.EmailLogAddOrEdit.EmailStateEnum">
|
||||||
|
<summary>
|
||||||
|
邮件状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.ExploreRecommendView">
|
<member name="T:IRaCIS.Core.Application.ViewModel.ExploreRecommendView">
|
||||||
<summary> ExploreRecommendView 列表视图模型 </summary>
|
<summary> ExploreRecommendView 列表视图模型 </summary>
|
||||||
</member>
|
</member>
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@
|
||||||
// 生成时间 2025-10-28 06:22:47Z
|
// 生成时间 2025-10-28 06:22:47Z
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
using System;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
namespace IRaCIS.Core.Application.ViewModel;
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
public class EmailLogView : EmailLogAddOrEdit
|
public class EmailLogView : EmailLogAddOrEdit
|
||||||
|
|
@ -23,49 +24,82 @@ public class EmailLogAddOrEdit
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
public string Attachments { get; set; }
|
/// <summary>
|
||||||
|
/// 邮件Id
|
||||||
public string CcRecipients { get; set; }
|
/// </summary>
|
||||||
|
|
||||||
public DateTime? EmailDate { get; set; }
|
|
||||||
|
|
||||||
public EmailState EmailStateEnum { get; set; }
|
|
||||||
|
|
||||||
public string EmailSubject { get; set; }
|
|
||||||
|
|
||||||
public string ErrorInfo { get; set; }
|
|
||||||
|
|
||||||
public string MessageId { get; set; }
|
public string MessageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 唯一Id
|
||||||
|
/// </summary>
|
||||||
|
public string UniqueId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮件主题
|
||||||
|
/// </summary>
|
||||||
|
public string EmailSubject { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 收件人
|
||||||
|
/// </summary>
|
||||||
|
public List<EmaliSendInfo> ToRecipients { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 抄送人
|
||||||
|
/// </summary>
|
||||||
|
public List<EmaliSendInfo> CcRecipients { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 附件
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Attachments { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? EmailDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 错误信息
|
||||||
|
/// </summary>
|
||||||
|
public string ErrorInfo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发件人地址
|
||||||
|
/// </summary>
|
||||||
public string SenderAddress { get; set; }
|
public string SenderAddress { get; set; }
|
||||||
|
|
||||||
public string ToRecipients { get; set; }
|
/// <summary>
|
||||||
|
/// 发件人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string SenderName { get; set; }
|
||||||
|
|
||||||
public string UniqueId { get; set; }
|
/// <summary>
|
||||||
}
|
/// 邮件内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮件状态
|
||||||
|
/// </summary>
|
||||||
|
public EmailState EmailStateEnum { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class EmailLogQuery:PageInput
|
public class EmailLogQuery:PageInput
|
||||||
{
|
{
|
||||||
public string Attachments { get; set; }
|
|
||||||
|
|
||||||
public string CcRecipients { get; set; }
|
|
||||||
|
|
||||||
public DateTime? EmailDate { get; set; }
|
public DateTime? EmailStartDate { get; set; }
|
||||||
|
|
||||||
public EmailState? EmailStateEnum { get; set; }
|
public DateTime? EmailEndDate { get; set; }
|
||||||
|
|
||||||
public string? EmailSubject { get; set; }
|
public EmailState EmailStateEnum { get; set; }
|
||||||
|
|
||||||
public string? ErrorInfo { get; set; }
|
public string? ToRecipientName { get; set; }
|
||||||
|
|
||||||
public string? MessageId { get; set; }
|
public string? CcRecipientName { get; set; }
|
||||||
|
|
||||||
public string? SenderAddress { get; set; }
|
}
|
||||||
|
|
||||||
public string ToRecipients { get; set; }
|
|
||||||
|
|
||||||
public string? UniqueId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,20 @@ using MailKit.Search;
|
||||||
using MailKit.Security;
|
using MailKit.Security;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using MimeKit;
|
||||||
|
using System.Net.Mail;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
namespace IRaCIS.Core.Application.Service;
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
[ ApiExplorerSettings(GroupName = "Test")]
|
/// <summary>
|
||||||
|
/// 邮件日志
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_emailLogRepository"></param>
|
||||||
|
/// <param name="systemEmailConfig"></param>
|
||||||
|
/// <param name="_mapper"></param>
|
||||||
|
/// <param name="_userInfo"></param>
|
||||||
|
/// <param name="_localizer"></param>
|
||||||
|
[ApiExplorerSettings(GroupName = "Common")]
|
||||||
public class EmailLogService(IRepository<EmailLog> _emailLogRepository,
|
public class EmailLogService(IRepository<EmailLog> _emailLogRepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService, IEmailLogService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService, IEmailLogService
|
||||||
|
|
@ -29,66 +39,293 @@ public class EmailLogService(IRepository<EmailLog> _emailLogRepository,
|
||||||
public async Task<PageOutput<EmailLogView>> GetEmailLogList(EmailLogQuery inQuery)
|
public async Task<PageOutput<EmailLogView>> GetEmailLogList(EmailLogQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
List<IMessageSummary> emailList = new List<IMessageSummary>();
|
PageOutput<EmailLogView> pageOutput = new PageOutput<EmailLogView>();
|
||||||
|
|
||||||
|
switch (inQuery.EmailStateEnum)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
using (var client = new ImapClient())
|
|
||||||
{
|
{
|
||||||
|
case EmailState.Success:
|
||||||
|
|
||||||
|
using (var client = new ImapClient())
|
||||||
try
|
|
||||||
{
|
|
||||||
// 连接阿里邮箱 IMAP 服务器(使用 SSL)
|
|
||||||
client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
|
|
||||||
|
|
||||||
// 登录
|
|
||||||
client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
|
||||||
|
|
||||||
// 3. 获取发件箱文件夹 - 使用你找到的“已发送”
|
|
||||||
var sentFolder = client.GetFolder("已发送");
|
|
||||||
sentFolder.Open(FolderAccess.ReadOnly);
|
|
||||||
|
|
||||||
// 4. 搜索所有邮件(你可以在这里添加更精确的搜索条件)
|
|
||||||
var uids = sentFolder.Search(SearchQuery.All);
|
|
||||||
Console.WriteLine($"找到 {uids.Count} 封已发送邮件");
|
|
||||||
|
|
||||||
// 5. 遍历并处理邮件(示例中处理前10封)
|
|
||||||
foreach (var uid in uids.Take(10))
|
|
||||||
{
|
{
|
||||||
var message = sentFolder.GetMessage(uid);
|
try
|
||||||
|
{
|
||||||
|
client.Connect(_systemEmailConfig.Imap, 993, SecureSocketOptions.SslOnConnect);
|
||||||
|
client.Authenticate(_systemEmailConfig.FromEmail, _systemEmailConfig.AuthorizationCode);
|
||||||
|
var sentFolder = client.GetFolder("已发送");
|
||||||
|
sentFolder.Open(FolderAccess.ReadOnly);
|
||||||
|
|
||||||
// 输出邮件基本信息
|
// 构建搜索查询条件
|
||||||
Console.WriteLine($"主题: {message.Subject}");
|
var searchQuery = BuildSearchQuery(inQuery);
|
||||||
Console.WriteLine($"收件人: {string.Join(", ", message.To.Mailboxes.Select(m => m.Address))}");
|
|
||||||
Console.WriteLine($"日期: {message.Date.LocalDateTime:yyyy-MM-dd HH:mm:ss}");
|
var orderBy = new[] { OrderBy.ReverseDate };
|
||||||
Console.WriteLine($"发件人: {message.From}");
|
// 搜索符合条件的邮件UID
|
||||||
Console.WriteLine("----------------------------------");
|
|
||||||
|
|
||||||
|
if (client.Capabilities.HasFlag(ImapCapabilities.Sort))
|
||||||
|
{
|
||||||
|
Console.WriteLine("服务器支持 SORT 扩展");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("服务器不支持 SORT,需本地排序");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//var uids = sentFolder.Sort(searchQuery, orderBy).Skip((inQuery.PageIndex - 1) * inQuery.PageSize).Take(inQuery.PageSize).ToList();
|
||||||
|
|
||||||
|
var uids = sentFolder.Search(searchQuery).Skip((inQuery.PageIndex - 1) * inQuery.PageSize).Take(inQuery.PageSize).ToList();
|
||||||
|
|
||||||
|
// 获取邮件并排序(按时间倒序)
|
||||||
|
var emailList = GetEmailsWithSorting(sentFolder, uids);
|
||||||
|
|
||||||
|
// 应用内存中的过滤条件(对于无法通过IMAP搜索的条件)
|
||||||
|
//var filteredEmails = ApplyMemoryFilters(emailList, inQuery);
|
||||||
|
|
||||||
|
pageOutput.TotalCount = sentFolder.Search(searchQuery).Count();
|
||||||
|
pageOutput.PageIndex = inQuery.PageIndex;
|
||||||
|
pageOutput.PageSize = inQuery.PageSize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pageOutput.CurrentPageData = emailList;
|
||||||
|
|
||||||
|
sentFolder.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
client.Disconnect(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sentFolder.Close();
|
return pageOutput;
|
||||||
|
case EmailState.Error:
|
||||||
|
var emailLogQueryable = _emailLogRepository
|
||||||
|
|
||||||
|
.ProjectTo<EmailLogView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
var pageList = await emailLogQueryable.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
return pageList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return pageOutput;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮件筛选条件构建
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private SearchQuery BuildSearchQuery(EmailLogQuery query)
|
||||||
|
{
|
||||||
|
var searchQuery = SearchQuery.All;
|
||||||
|
|
||||||
|
// 日期范围筛选
|
||||||
|
if (query.EmailStartDate.HasValue || query.EmailEndDate.HasValue)
|
||||||
|
{
|
||||||
|
var startDate = query.EmailStartDate ?? DateTime.MinValue;
|
||||||
|
var endDate = query.EmailEndDate ?? DateTime.MaxValue;
|
||||||
|
|
||||||
|
searchQuery = searchQuery.And(SearchQuery.DeliveredAfter(startDate)
|
||||||
|
.And(SearchQuery.DeliveredBefore(endDate.AddDays(1)))); // 包含结束日期当天
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主题关键词筛选(如果IMAP服务器支持)
|
||||||
|
//if (!string.IsNullOrEmpty(query.ToRecipientName))
|
||||||
|
//{
|
||||||
|
// searchQuery = searchQuery.And(SearchQuery.HeaderContains("To", query.ToRecipientName));
|
||||||
|
//}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(query.ToRecipientName))
|
||||||
|
{
|
||||||
|
searchQuery = searchQuery.And(SearchQuery.SubjectContains(query.ToRecipientName));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(query.ToRecipientName))
|
||||||
|
{
|
||||||
|
searchQuery = searchQuery.And(SearchQuery.HeaderContains("Cc", query.CcRecipientName));
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮件排序处理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sentFolder"></param>
|
||||||
|
/// <param name="uids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private List<EmailLogView> GetEmailsWithSorting(IMailFolder sentFolder, IList<UniqueId> uids)
|
||||||
|
{
|
||||||
|
var emailList = new List<EmailLogView>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取完整的邮件信息
|
||||||
|
foreach (var uid in uids)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var message = sentFolder.GetMessage(uid);
|
||||||
|
var emailView = ConvertToEmailLogView(uid, message);
|
||||||
|
emailList.Add(emailView);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"操作失败: {ex.Message}");
|
Console.WriteLine($"处理邮件 {uid} 失败: {ex.Message}");
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
client.Disconnect(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var emailLogQueryable =_emailLogRepository
|
return emailList;
|
||||||
.ProjectTo<EmailLogView>(_mapper.ConfigurationProvider);
|
}
|
||||||
|
|
||||||
var pageList= await emailLogQueryable.ToPagedListAsync(inQuery);
|
/// <summary>
|
||||||
|
/// 获取完整的邮件信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uid"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private EmailLogView ConvertToEmailLogView(UniqueId uid, MimeMessage message)
|
||||||
|
{
|
||||||
|
var emailView = new EmailLogView
|
||||||
|
{
|
||||||
|
UniqueId = uid.ToString(),
|
||||||
|
MessageId = message.MessageId ?? string.Empty,
|
||||||
|
EmailSubject = message.Subject ?? string.Empty,
|
||||||
|
EmailDate = message.Date.UtcDateTime,
|
||||||
|
Content = message.HtmlBody ?? string.Empty,
|
||||||
|
};
|
||||||
|
|
||||||
return pageList;
|
// 处理发件人信息
|
||||||
}
|
var fromMailbox = message.From.Mailboxes.FirstOrDefault();
|
||||||
|
if (fromMailbox != null)
|
||||||
|
{
|
||||||
|
emailView.SenderAddress = fromMailbox.Address;
|
||||||
|
emailView.SenderName = fromMailbox.Name ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理收件人
|
||||||
|
emailView.ToRecipients = message.To.Mailboxes.Select(address => new EmaliSendInfo
|
||||||
|
{
|
||||||
|
Name = address.Name ?? string.Empty,
|
||||||
|
Address = address.Address
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
// 处理抄送人
|
||||||
|
emailView.CcRecipients = message.Cc.Mailboxes.Select(address => new EmaliSendInfo
|
||||||
|
{
|
||||||
|
Name = address.Name ?? string.Empty,
|
||||||
|
Address = address.Address
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
//// 处理密送人
|
||||||
|
//emailView.BccRecipients = message.Bcc.Mailboxes.Select(address => new EmaliSendInfo
|
||||||
|
//{
|
||||||
|
// Name = address.Name ?? string.Empty,
|
||||||
|
// Address = address.Address
|
||||||
|
//}).ToList();
|
||||||
|
|
||||||
|
// 处理附件
|
||||||
|
//emailView.Attachments = ProcessAttachments(message);
|
||||||
|
//emailView.HasAttachments = emailView.Attachments.Any();
|
||||||
|
//emailView.AttachmentCount = emailView.Attachments.Count;
|
||||||
|
|
||||||
|
return emailView;
|
||||||
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 处理附件信息
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="message"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private List<EmailAttachmentInfo> ProcessAttachments(MimeMessage message)
|
||||||
|
//{
|
||||||
|
// var attachments = new List<EmailAttachmentInfo>();
|
||||||
|
|
||||||
|
// foreach (var attachment in message.Attachments)
|
||||||
|
// {
|
||||||
|
// var attachmentInfo = new EmailAttachmentInfo();
|
||||||
|
|
||||||
|
// if (attachment is MimePart mimePart)
|
||||||
|
// {
|
||||||
|
// attachmentInfo.FileName = mimePart.FileName ??
|
||||||
|
// mimePart.ContentType?.Name ??
|
||||||
|
// "未知文件";
|
||||||
|
// attachmentInfo.ContentType = mimePart.ContentType.MimeType;
|
||||||
|
// attachmentInfo.ContentId = mimePart.ContentId ?? string.Empty;
|
||||||
|
// attachmentInfo.IsInline = mimePart.ContentDisposition != null &&
|
||||||
|
// mimePart.ContentDisposition.Disposition.Equals("inline", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
// // 获取附件大小
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (mimePart.ContentObject.Stream != null)
|
||||||
|
// {
|
||||||
|
// attachmentInfo.Size = mimePart.ContentObject.Stream.Length;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch
|
||||||
|
// {
|
||||||
|
// attachmentInfo.Size = 0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else if (attachment is MessagePart messagePart)
|
||||||
|
// {
|
||||||
|
// // 处理内嵌消息作为附件的情况
|
||||||
|
// attachmentInfo.FileName = "embedded-message.eml";
|
||||||
|
// attachmentInfo.ContentType = "message/rfc822";
|
||||||
|
// attachmentInfo.IsInline = false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// attachments.Add(attachmentInfo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return attachments;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用内存中的过滤条件(对于无法通过IMAP搜索的条件)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="emails"></param>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private List<EmailLogView> ApplyMemoryFilters(List<EmailLogView> emails, EmailLogQuery query)
|
||||||
|
{
|
||||||
|
var filtered = emails.AsEnumerable();
|
||||||
|
|
||||||
|
// 收件人姓名筛选
|
||||||
|
//if (!string.IsNullOrEmpty(query.Keyword))
|
||||||
|
//{
|
||||||
|
// filtered = filtered.Where(e =>
|
||||||
|
// e.ToRecipients.Any(r =>
|
||||||
|
// r.Name.Contains(query.Keyword, StringComparison.OrdinalIgnoreCase)) ||
|
||||||
|
// e.CcRecipients.Any(r =>
|
||||||
|
// r.Name.Contains(query.Keyword, StringComparison.OrdinalIgnoreCase))
|
||||||
|
|
||||||
|
// );
|
||||||
|
//}
|
||||||
|
|
||||||
|
// 发件人姓名筛选
|
||||||
|
//if (!string.IsNullOrEmpty(query.SenderName))
|
||||||
|
//{
|
||||||
|
// filtered = filtered.Where(e =>
|
||||||
|
// e.SenderName.Contains(query.SenderName, StringComparison.OrdinalIgnoreCase));
|
||||||
|
//}
|
||||||
|
|
||||||
|
return filtered.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateEmailLog(EmailLogAddOrEdit addOrEditEmailLog)
|
public async Task<IResponseOutput> AddOrUpdateEmailLog(EmailLogAddOrEdit addOrEditEmailLog)
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@ public class EmailLog : BaseFullAuditEntity
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 收件人
|
/// 收件人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ToRecipients { get; set; }
|
public List<EmaliSendInfo> ToRecipients { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 抄送人
|
/// 抄送人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> CcRecipients { get; set; }
|
public List<EmaliSendInfo> CcRecipients { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 附件
|
/// 附件
|
||||||
|
|
@ -51,10 +51,28 @@ public class EmailLog : BaseFullAuditEntity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SenderAddress { get; set; }
|
public string SenderAddress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发件人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string SenderName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮件状态
|
/// 邮件状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EmailState EmailStateEnum { get; set; }
|
public EmailState EmailStateEnum { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 邮件内容
|
||||||
|
/// </summary>
|
||||||
|
[MaxLength]
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmaliSendInfo
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string Address { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,20 @@ public class IRaCISDBContext : DbContext
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<EmailLog>(entity =>
|
||||||
|
{
|
||||||
|
entity.OwnsMany(x => x.ToRecipients, ownedNavigationBuilder =>
|
||||||
|
{
|
||||||
|
ownedNavigationBuilder.ToJson();
|
||||||
|
});
|
||||||
|
|
||||||
|
entity.OwnsMany(x => x.CcRecipients, ownedNavigationBuilder =>
|
||||||
|
{
|
||||||
|
ownedNavigationBuilder.ToJson();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
#region pgsql codefirst 配置 暂时屏蔽
|
#region pgsql codefirst 配置 暂时屏蔽
|
||||||
//if (base.Database.IsNpgsql())
|
//if (base.Database.IsNpgsql())
|
||||||
//{
|
//{
|
||||||
|
|
|
||||||
20960
IRaCIS.Core.Infra.EFCore/Migrations/20251029014908_EmailLog1.Designer.cs
generated
Normal file
20960
IRaCIS.Core.Infra.EFCore/Migrations/20251029014908_EmailLog1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,77 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class EmailLog1 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ToRecipients",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "CcRecipients",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Content",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "SenderName",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(400)",
|
||||||
|
maxLength: 400,
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Content",
|
||||||
|
table: "EmailLog");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SenderName",
|
||||||
|
table: "EmailLog");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ToRecipients",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "",
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "CcRecipients",
|
||||||
|
table: "EmailLog",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "",
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2309,7 +2309,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("CcRecipients")
|
b.Property<string>("Content")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
|
@ -2345,9 +2345,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
.HasColumnType("nvarchar(400)");
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
b.Property<string>("ToRecipients")
|
b.Property<string>("SenderName")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
b.Property<string>("UniqueId")
|
b.Property<string>("UniqueId")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
|
|
@ -16447,7 +16448,69 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.OwnsMany("IRaCIS.Core.Domain.Models.EmaliSendInfo", "CcRecipients", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<Guid>("EmailLogId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b1.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b1.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b1.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b1.HasKey("EmailLogId", "Id");
|
||||||
|
|
||||||
|
b1.ToTable("EmailLog");
|
||||||
|
|
||||||
|
b1.ToJson("CcRecipients");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("EmailLogId");
|
||||||
|
});
|
||||||
|
|
||||||
|
b.OwnsMany("IRaCIS.Core.Domain.Models.EmaliSendInfo", "ToRecipients", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<Guid>("EmailLogId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b1.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b1.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b1.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b1.HasKey("EmailLogId", "Id");
|
||||||
|
|
||||||
|
b1.ToTable("EmailLog");
|
||||||
|
|
||||||
|
b1.ToJson("ToRecipients");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("EmailLogId");
|
||||||
|
});
|
||||||
|
|
||||||
|
b.Navigation("CcRecipients");
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
|
b.Navigation("ToRecipients");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.EmailNoticeConfig", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.EmailNoticeConfig", b =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue