//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-06-07 13:14:38 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- using IRaCIS.Core.Domain.Models; using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Service { /// /// 分配规则 /// [ApiExplorerSettings(GroupName = "Trial")] public class TaskAllocationRuleService : BaseService, ITaskAllocationRuleService { private readonly IRepository _taskAllocationRuleRepository; public TaskAllocationRuleService(IRepository taskAllocationRuleRepository) { _taskAllocationRuleRepository = taskAllocationRuleRepository; } public async Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) { var taskAllocationRuleQueryable = _repository.GetQueryable() .ProjectTo(_mapper.ConfigurationProvider); return await taskAllocationRuleQueryable.ToListAsync(); } public async Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule) { var entity = await _taskAllocationRuleRepository.InsertOrUpdateAsync(addOrEditTaskAllocationRule, true); return ResponseOutput.Ok(entity.Id.ToString()); } [HttpDelete("{taskAllocationRuleId:guid}")] public async Task DeleteTaskAllocationRule(Guid taskAllocationRuleId) { var success = await _taskAllocationRuleRepository.DeleteFromQueryAsync(t => t.Id == taskAllocationRuleId, true); return ResponseOutput.Ok(); } } }