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