|
|
@ -1,4 +1,5 @@ |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using EFCore.BulkExtensions; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Shouldly; |
|
|
|
using System; |
|
|
@ -76,10 +77,10 @@ namespace Win.Sfs.SettleAccount.Entities.Controls |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 新增实体
|
|
|
|
/// 添加
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost] |
|
|
|
virtual public async Task<CentralizedControlDto> CreateAsync(CentralizedControlCreateDto input) |
|
|
|
public async Task<CentralizedControlDto> CreateAsync(CentralizedControlCreateDto input) |
|
|
|
{ |
|
|
|
var _first = _repository.Where(p => p.Version == input.Version).FirstOrDefault(); |
|
|
|
|
|
|
@ -103,6 +104,30 @@ namespace Win.Sfs.SettleAccount.Entities.Controls |
|
|
|
return dto; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 删除实体
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">ID</param>
|
|
|
|
/// <returns>无</returns>
|
|
|
|
[HttpDelete] |
|
|
|
public async Task DeleteAsync(Guid id) |
|
|
|
{ |
|
|
|
var entity = await _repository.GetAsync(id); |
|
|
|
await _repository.DeleteAsync(id); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 按IDs删除实体列表
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<bool> DeleteListAsync(List<Guid> ids) |
|
|
|
{ |
|
|
|
var _query = _repository.Where(p => ids.Contains(p.Id)); |
|
|
|
int i = await _query.BatchDeleteAsync(); |
|
|
|
|
|
|
|
return i == 0; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 开启、关闭
|
|
|
|