添加实体
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
75d3908911
commit
456793293b
|
|
@ -0,0 +1,72 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-10-28 06:22:47Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class EmailLogView : EmailLogAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EmailLogAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public List`1 Attachments { get; set; }
|
||||||
|
|
||||||
|
public List`1 CcRecipients { get; set; }
|
||||||
|
|
||||||
|
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 SenderAddress { get; set; }
|
||||||
|
|
||||||
|
public List`1 ToRecipients { get; set; }
|
||||||
|
|
||||||
|
public string UniqueId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmailLogQuery:PageInput
|
||||||
|
{
|
||||||
|
public List`1? Attachments { get; set; }
|
||||||
|
|
||||||
|
public List`1? CcRecipients { get; set; }
|
||||||
|
|
||||||
|
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? SenderAddress { get; set; }
|
||||||
|
|
||||||
|
public List`1? ToRecipients { get; set; }
|
||||||
|
|
||||||
|
public string? UniqueId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-10-28 06:22:42Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
|
[ ApiExplorerSettings(GroupName = "Test")]
|
||||||
|
public class EmailLogService(IRepository<EmailLog> _emailLogRepository,
|
||||||
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService, IEmailLogService
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<EmailLogView>> GetEmailLogList(EmailLogQuery inQuery)
|
||||||
|
{
|
||||||
|
|
||||||
|
var emailLogQueryable =_emailLogRepository
|
||||||
|
.ProjectTo<EmailLogView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
var pageList= await emailLogQueryable.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> AddOrUpdateEmailLog(EmailLogAddOrEdit addOrEditEmailLog)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var entity = await _emailLogRepository.InsertOrUpdateAsync(addOrEditEmailLog, true);
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpDelete("{emailLogId:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeleteEmailLog(Guid emailLogId)
|
||||||
|
{
|
||||||
|
var success = await _emailLogRepository.DeleteFromQueryAsync(t => t.Id == emailLogId,true);
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-10-28 06:22:47Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface IEmailLogService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<EmailLogView>> GetEmailLogList(EmailLogQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateEmailLog(EmailLogAddOrEdit addOrEditEmailLog);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteEmailLog(Guid emailLogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -10,7 +10,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
public CommonConfig()
|
public CommonConfig()
|
||||||
{
|
{
|
||||||
|
// 在此处拷贝automapper 映射
|
||||||
|
|
||||||
|
CreateMap<EmailLog, EmailLogView>();
|
||||||
|
CreateMap<EmailLog, EmailLogAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
CreateMap<FrontAuditConfig, FrontAuditConfigAddOrEdit>().ReverseMap();
|
CreateMap<FrontAuditConfig, FrontAuditConfigAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue