FileUpdateInfoService.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Attribute;
  2. using Dto;
  3. using Vo;
  4. using Model;
  5. using Model.Base;
  6. using Repository;
  7. using Service;
  8. using Microsoft.AspNetCore.Mvc;
  9. namespace Services.Client
  10. {
  11. /// <summary>
  12. /// 资源文件更新信息Service业务层处理
  13. /// </summary>
  14. [AppService(ServiceType = typeof(IFileUpdateInfoService), ServiceLifetime = LifeTime.Transient)]
  15. public class FileUpdateInfoService : BaseService<FileUpdateInfo>, IFileUpdateInfoService
  16. {
  17. /// <summary>
  18. /// APP-静态资源
  19. /// </summary>
  20. /// <param name="parm">请求参数</param>
  21. /// <returns>APP静态资源</returns>
  22. public PagedInfo<AppStaticFilesVo> StaticFiles([FromQuery] AppStaticFilesDto parm)
  23. {
  24. PagerInfo page = new PagerInfo();
  25. page.pageSize = 100000;
  26. //开始拼装查询条件
  27. var predicate = Expressionable.Create<FileUpdateInfo>();
  28. predicate = predicate.And(m => m.appVersion == parm.appVersion);
  29. predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
  30. var response = Queryable()
  31. .Where(predicate.ToExpression())
  32. .OrderByDescending(m => m.id)
  33. .ToPage<FileUpdateInfo, AppStaticFilesVo>(page);
  34. return response;
  35. }
  36. }
  37. }