using Attribute; using Model; using Model.Base; using Repository; using Service; using Microsoft.AspNetCore.Mvc; using Vo.Admin; namespace Services { /// /// 奖励项目Service业务层处理 /// [AppService(ServiceType = typeof(IPriProjectService), ServiceLifetime = LifeTime.Transient)] public class PriProjectService : BaseService, IPriProjectService { /// /// 奖励项目-列表 /// /// 参数请求体 /// 分页参数 /// 列表 public PagedInfo getPriProjectList([FromQuery] PagerInfo page, [FromQuery] PriProject param) { //拼装查询条件 var predicate = Expressionable.Create(); predicate = predicate.AndIF(!string.IsNullOrEmpty(param.projectName), m => m.projectName.Contains(param.projectName)); predicate = predicate.AndIF(!string.IsNullOrEmpty(param.requestMode), m => m.requestMode.Contains(param.requestMode)); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(m => m.id) .ToPage(page); return response; } /// /// 奖励项目-下拉框数据 /// /// 分页参数 /// 下拉框数据 public PagedInfo getPriProjectDic([FromQuery] PagerInfo page) { //拼装查询条件 var predicate = Expressionable.Create(); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(m => m.id) .ToPage(page); return response; } } }