AppBottomNavsService.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. using Common;
  10. namespace Services
  11. {
  12. /// <summary>
  13. /// app底部导航Service业务层处理
  14. /// </summary>
  15. [AppService(ServiceType = typeof(IAppBottomNavsService), ServiceLifetime = LifeTime.Transient)]
  16. public class AppBottomNavsService : BaseService<AppBottomNavs>, IAppBottomNavsService
  17. {
  18. /// <summary>
  19. /// app底部导航-列表
  20. /// </summary>
  21. /// <param name="parm">请求参数</param>
  22. /// <returns>app底部导航列表</returns>
  23. public PagedInfo<AppBottomNavsListVo> List([FromQuery] AppBottomNavsListDto parm)
  24. {
  25. //开始拼装查询条件
  26. var predicate = Expressionable.Create<AppBottomNavs>();
  27. predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
  28. var response = Queryable()
  29. .Where(predicate.ToExpression())
  30. .OrderByDescending(m => m.id)
  31. .ToPage<AppBottomNavs, AppBottomNavsListVo>(new PagerInfo());
  32. return response;
  33. }
  34. /// <summary>
  35. /// 生成APP配置文件
  36. /// </summary>
  37. /// <param name="parm">请求参数</param>
  38. /// <returns>生成APP配置文件</returns>
  39. public string makeAppInitData(string kind)
  40. {
  41. var obj = GetList(m => m.kind == kind);
  42. string str = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
  43. return Dbconn.Encrypt3DES(str, "*ga34|^7");
  44. }
  45. }
  46. }