using Attribute; using Dto; using Vo; using Model; using Model.Base; using Repository; using Service; using Microsoft.AspNetCore.Mvc; namespace Services { /// /// api接口Service业务层处理 /// [AppService(ServiceType = typeof(IApiInfoService), ServiceLifetime = LifeTime.Transient)] public class ApiInfoService : BaseService, IApiInfoService { /// /// api接口-列表 /// /// 请求参数 /// api接口列表 public PagedInfo List([FromQuery] PagerInfo page, [FromQuery] ApiInfoListDto parm) { //开始拼装查询条件 var predicate = Expressionable.Create(); predicate = predicate.AndIF(parm.groupId > 0, m => m.groupId == parm.groupId); predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.apiName), m => m.apiName.Contains(parm.apiName)); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(m => m.id) .Includes(m => m.apiGroupJoin) .ToPage(page); return response; } } }