修改表

This commit is contained in:
2022-10-21 14:10:26 +08:00
parent 6892da7dd4
commit d126daff6c
4 changed files with 18 additions and 41 deletions
@@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application.Contracts
///<summary> EmailNoticeConfigAddOrEdit 列表查询参数模型</summary>
public class EmailNoticeConfigAddOrEdit
{
public Guid Id { get; set; }
public Guid? Id { get; set; }
public string Code { get; set; } = String.Empty;
@@ -16,18 +16,18 @@ namespace IRaCIS.Core.Application.Contracts
[ApiExplorerSettings(GroupName = "Common")]
public class EmailNoticeConfigService : BaseService, IEmailNoticeConfigService
{
private readonly IRepository<EmailNoticeConfig> repository;
private readonly IRepository<EmailNoticeConfig> _emailNoticeConfigrepository;
public EmailNoticeConfigService(IRepository<EmailNoticeConfig> repository)
{
this.repository = repository;
_emailNoticeConfigrepository = repository;
}
[HttpPost]
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
{
var emailNoticeConfigQueryable = _repository
.WhereIf<EmailNoticeConfig>(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
.WhereIf(queryEmailNoticeConfig.IsUrgent != null, t => t.IsUrgent == queryEmailNoticeConfig.IsUrgent)
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
@@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Contracts
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
{
var entity = await _repository.InsertOrUpdateAsync<EmailNoticeConfig, EmailNoticeConfigAddOrEdit>(addOrEditEmailNoticeConfig, true);
var entity = await _emailNoticeConfigrepository.InsertOrUpdateAsync(addOrEditEmailNoticeConfig, true);
return ResponseOutput.Ok(entity.Id.ToString());
@@ -50,7 +50,7 @@ namespace IRaCIS.Core.Application.Contracts
[HttpDelete("{emailNoticeConfigId:guid}")]
public async Task<IResponseOutput> DeleteEmailNoticeConfig(Guid emailNoticeConfigId)
{
var success = await repository.BatchDeleteNoTrackingAsync(t => t.Id == emailNoticeConfigId);
var success = await _emailNoticeConfigrepository.BatchDeleteNoTrackingAsync(t => t.Id == emailNoticeConfigId);
return ResponseOutput.Result(success);
}