12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Attribute;
- using Dto;
- using Vo;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- namespace Services
- {
- /// <summary>
- /// api接口Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(IApiInfoService), ServiceLifetime = LifeTime.Transient)]
- public class ApiInfoService : BaseService<ApiInfo>, IApiInfoService
- {
- /// <summary>
- /// api接口-列表
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>api接口列表</returns>
- public PagedInfo<ApiInfoListVo> List([FromQuery] PagerInfo page, [FromQuery] ApiInfoListDto parm)
- {
- //开始拼装查询条件
- var predicate = Expressionable.Create<ApiInfo>();
- 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<ApiInfo, ApiInfoListVo>(page);
- return response;
- }
- }
- }
|