1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using Attribute;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- using Vo.Admin;
- namespace Services
- {
- /// <summary>
- /// 递归配置Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(IPriLoopSetService), ServiceLifetime = LifeTime.Transient)]
- public class PriLoopSetService : BaseService<PriLoopSet>, IPriLoopSetService
- {
- /// <summary>
- /// 递归配置-列表
- /// </summary>
- /// <param name="listId">配置ID</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetPriLoopSetListVo> getPriLoopSetList([FromQuery] PagerInfo page, [FromQuery] PriLoopSet param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriLoopSet>();
- predicate = predicate.AndIF(param.listId > 0, m => m.listId == param.listId);
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriLoopSet, GetPriLoopSetListVo>(page);
- return response;
- }
- /// <summary>
- /// 递归配置-下拉框数据
- /// </summary>
- /// <param name="page">分页参数</param>
- /// <returns>下拉框数据</returns>
- public PagedInfo<GetPriLoopSetDicVo> getPriLoopSetDic([FromQuery] PagerInfo page)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriLoopSet>();
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriLoopSet, GetPriLoopSetDicVo>(page);
- return response;
- }
- }
- }
|