|
@@ -1,9 +1,13 @@
|
|
|
using Exam.Application.Interface.Exam;
|
|
|
using Exam.ExamManages;
|
|
|
using Exam.Infrastructure.Data.Entity;
|
|
|
+using Exam.Infrastructure.Extensions;
|
|
|
using Exam.Insfrastructure.Service.Service;
|
|
|
using Exam.Share.ViewResponses.Sourceware;
|
|
|
+using Hotline.Application.Exam.Constants.Messages;
|
|
|
+using Hotline.Application.Exam.Extensions;
|
|
|
using Hotline.Application.Exam.QueryExtensions.ExamManages;
|
|
|
+using Hotline.Exams.Sourcewares;
|
|
|
using Hotline.Repository.SqlSugar;
|
|
|
using Hotline.Repository.SqlSugar.Exam.Interfaces.ExamManages;
|
|
|
using Hotline.Share.Dtos.ExamManages;
|
|
@@ -13,6 +17,7 @@ using Hotline.Share.ViewResponses.Exam;
|
|
|
using Mapster;
|
|
|
using System.ComponentModel;
|
|
|
using XF.Domain.Dependency;
|
|
|
+using XF.Domain.Exceptions;
|
|
|
|
|
|
namespace Hotline.Application.Exam.Service.ExamManages
|
|
|
{
|
|
@@ -82,6 +87,23 @@ namespace Hotline.Application.Exam.Service.ExamManages
|
|
|
|
|
|
return sourcewareCategoryViewResponses;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 删除考试标签
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="entityQueryRequest"></param>
|
|
|
+ /// <param name="cancellationToken"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="UserFriendlyException"></exception>
|
|
|
+ public override Task DeleteAsync(EntityQueryRequest entityQueryRequest, CancellationToken cancellationToken)
|
|
|
+ {
|
|
|
+ if (_repository.CheckHasChild(entityQueryRequest))
|
|
|
+ {
|
|
|
+ throw new UserFriendlyException(string.Format(ErrorMessage.HasChild, typeof(ExamTag).GetDescription()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return base.DeleteAsync(entityQueryRequest, cancellationToken);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|