123456789101112131415161718192021222324252627282930313233343536373839 |
- 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(IPriConditionService), ServiceLifetime = LifeTime.Transient)]
- public class PriConditionService : BaseService<PriCondition>, IPriConditionService
- {
- /// <summary>
- /// 奖励条件-列表
- /// </summary>
- /// <param name="listId">配置ID</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetPriConditionListVo> getPriConditionList([FromQuery] PagerInfo page, [FromQuery] PriCondition param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriCondition>();
- predicate = predicate.AndIF(param.listId > 0, m => m.listId == param.listId);
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriCondition, GetPriConditionListVo>(page);
- return response;
- }
- }
- }
|