mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-06 01:06:38 +08:00
feat: 完成查询动态条件筛选,做一个快乐的crud boy
This commit is contained in:
@@ -3,6 +3,9 @@ using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using SqlSugar;
|
||||
using Yi.RBAC.Application.Contracts.Setting.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Identity
|
||||
{
|
||||
@@ -13,5 +16,16 @@ namespace Yi.RBAC.Application.Identity
|
||||
public class PostService : CrudAppService<PostEntity, PostGetOutputDto, PostGetListOutputDto, long, PostGetListInputVo, PostCreateInputVo, PostUpdateInputVo>,
|
||||
IPostService, IAutoApiService
|
||||
{
|
||||
public override async Task<PagedResultDto<PostGetListOutputDto>> GetListAsync(PostGetListInputVo input)
|
||||
{
|
||||
var entity = await MapToEntityAsync(input);
|
||||
|
||||
RefAsync<int> total = 0;
|
||||
|
||||
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.PostName), x => x.PostName.Contains(input.PostName!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
return new PagedResultDto<PostGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user