59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
|
|
//--------------------------------------------------------------------
|
|
// 此代码由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();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|