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 IdleWatersApp : SqlSugarBaseApp { public IdleWatersApp( ISugarUnitOfWork unitWork, ISimpleClient repository, IAuth auth ) : base(unitWork, repository, auth) { } #region 查询 /// /// 分页 /// public async Task>>> LoadPage(PageReq request) { RefAsync totalCount = 0; var result = new PageInfo(); 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>> { Result = new PageInfo> { Items = list, Total = totalCount } }; } /// /// 详情 /// /// /// public async Task Detail(string id) { return await Repository.GetByIdAsync(id); } #endregion } }