From 61cc6aafc5d6a35aaf13bb0e216d4c90f4911248 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 19:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackContents/TrackContentService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index dfd3d7dd..281fed37 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -20,7 +20,7 @@ namespace SJZY.Track.Application.Services.TrackContents public TrackContentService( IStringLocalizer stringLocalizer, ITrackContentRepository trackContentRepository - + ) { this._stringLocalizer = stringLocalizer; @@ -111,10 +111,8 @@ namespace SJZY.Track.Application.Services.TrackContents { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } - //更新的时候需要覆盖内容映射轨迹代码 - #endregion - + //更新的时候需要覆盖内容映射轨迹代码 var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); ObjectMapper.Map(input, templateEntity); var isTrue = await _trackContentRepository.UpdateAsync(templateEntity); @@ -124,6 +122,9 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task DeleteAsync(EditTrackContentInput input) { + #region 业务校验 + //需要加个判断,存在内容映射,则出提示 + #endregion var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue);