字典页面与字典信息页面完成增删改查

This commit is contained in:
chenchun
2022-09-10 20:25:39 +08:00
parent 9f23b911c1
commit b5ad7a1721
8 changed files with 96 additions and 14 deletions

View File

@@ -130,6 +130,20 @@
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.DelList(System.Collections.Generic.List{System.Int64})">
<summary>
id范围删除
</summary>
<param name="ids"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.Update(Yi.Framework.Model.Models.DictionaryEntity)">
<summary>
更新
</summary>
<param name="dic"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.PageList(Yi.Framework.Model.Models.DictionaryInfoEntity,Yi.Framework.Common.Models.PageParModel)">
<summary>
动态条件分页查询
@@ -159,6 +173,20 @@
<param name="ids"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.Update(Yi.Framework.Model.Models.DictionaryInfoEntity)">
<summary>
更新
</summary>
<param name="dicInfo"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.GetById(System.Int64)">
<summary>
根据字典id获取字典信息表
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.FileController">
<summary>
文件

View File

@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Helper;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
@@ -73,5 +74,29 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
return Result.Success().SetData(await _iDictionaryService._repository.GetListAsync());
}
/// <summary>
/// id范围删除
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpDelete]
public async Task<Result> DelList(List<long> ids)
{
return Result.Success().SetStatus(await _iDictionaryService._repository.DeleteByIdsAsync(ids.ToDynamicArray()));
}
/// <summary>
/// 更新
/// </summary>
/// <param name="dic"></param>
/// <returns></returns>
[HttpPut]
public async Task<Result> Update(DictionaryEntity dic)
{
return Result.Success().SetStatus(await _iDictionaryService._repository.UpdateIgnoreNullAsync(dic));
}
}
}

View File

@@ -76,5 +76,29 @@ namespace Yi.Framework.ApiMicroservice.Controllers
return Result.Success().SetStatus(await _iDictionaryInfoService._repository.DeleteByIdsAsync(ids.ToDynamicArray()));
}
/// <summary>
/// 更新
/// </summary>
/// <param name="dicInfo"></param>
/// <returns></returns>
[HttpPut]
public async Task<Result> Update(DictionaryInfoEntity dicInfo)
{
return Result.Success().SetStatus(await _iDictionaryInfoService._repository.UpdateIgnoreNullAsync(dicInfo));
}
/// <summary>
/// 根据字典id获取字典信息表
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
public async Task<Result> GetById(long id)
{
return Result.Success().SetData(await _iDictionaryInfoService._repository.GetByIdAsync(id));
}
}
}