添加排序
This commit is contained in:
@@ -118,12 +118,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public class ChangeFrontAuditSortDto
|
||||
{
|
||||
|
||||
public List<FrontAuditSort> SortData { get; set; }
|
||||
}
|
||||
|
||||
public class FrontAuditSort
|
||||
{
|
||||
//public Guid
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public int Sort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary> FrontAuditConfigAddOrEdit 列表查询参数模型</summary>
|
||||
|
||||
@@ -164,10 +164,24 @@ namespace IRaCIS.Core.Application.Service
|
||||
return await query.OrderBy(x=>x.Sort).ToListAsync();
|
||||
}
|
||||
|
||||
//public async Task<IResponseOutput> ChangeFrontAuditSort()
|
||||
//{
|
||||
// _frontAuditConfigRepository.UpdateFromQueryAsync(x=>)
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 修改排序
|
||||
/// </summary>
|
||||
/// <param name="sortDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ChangeFrontAuditSort(ChangeFrontAuditSortDto sortDto)
|
||||
{
|
||||
foreach (var item in sortDto.SortData)
|
||||
{
|
||||
await _frontAuditConfigRepository.UpdateFromQueryAsync(x => x.Id == item.Id, x => new FrontAuditConfig
|
||||
{
|
||||
Sort = item.Sort
|
||||
});
|
||||
}
|
||||
await _frontAuditConfigRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增或者修改
|
||||
|
||||
Reference in New Issue
Block a user