using Attribute; using Dto; using Vo; using Model; using Model.Base; using Repository; using Service; using Microsoft.AspNetCore.Mvc; namespace Services { /// /// 字典项Service业务层处理 /// [AppService(ServiceType = typeof(ISysDictItemService), ServiceLifetime = LifeTime.Transient)] public class SysDictItemService : BaseService, ISysDictItemService { /// /// 字典项-列表 /// /// 请求参数 /// 字典项列表 public PagedInfo List([FromQuery] SysDictItemListDto parm) { //开始拼装查询条件 var predicate = Expressionable.Create(); predicate = predicate.AndIF(parm.dictId != null, m => m.dictId == parm.dictId); predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.label), m => m.label.Contains(parm.label)); predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.description), m => m.description.Contains(parm.description)); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(m => m.id) .ToPage(new PagerInfo()); return response; } } }