47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
|
|
using OpenAuth.App.Interface;
|
|
using OpenAuth.App.Response;
|
|
using OpenAuth.Repository.Domain;
|
|
using Infrastructure;
|
|
using OpenAuth.App.Request;
|
|
using OpenAuth.Repository;
|
|
using SqlSugar;
|
|
|
|
namespace OpenAuth.App
|
|
{
|
|
public class IdleHouseApp : SqlSugarBaseApp<IdleHouse, SugarDbContext>
|
|
{
|
|
public IdleHouseApp(
|
|
ISugarUnitOfWork<SugarDbContext> unitWork,
|
|
ISimpleClient<IdleHouse> repository,
|
|
IAuth auth
|
|
) : base(unitWork, repository, auth)
|
|
{
|
|
|
|
}
|
|
|
|
#region 查询
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
public async Task<Response<PageInfo<List<IdleHouse>>>> LoadPage(PageReq request)
|
|
{
|
|
RefAsync<int> totalCount = 0;
|
|
var result = new PageInfo<IdleHouse>();
|
|
var list = await base.Repository.AsQueryable()
|
|
.WhereIF(!string.IsNullOrEmpty(request.key), a => a.SerialNumber.Contains(request.key))
|
|
.ToPageListAsync(request.page, request.limit, totalCount);
|
|
|
|
return new Response<PageInfo<List<IdleHouse>>>
|
|
{
|
|
Result = new PageInfo<List<IdleHouse>>
|
|
{
|
|
Items = list,
|
|
Total = totalCount
|
|
}
|
|
};
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
} |