You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NewsApi.cs 3.0 KiB

4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using Learun.Application.AppMagager;
  2. using Learun.Util;
  3. using Nancy;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using Learun.Application.Base.SystemModule;
  7. using Learun.Application.TwoDevelopment.LR_Desktop;
  8. using System.Text;
  9. using System.Data;
  10. using Learun.Application.OA;
  11. namespace Learun.Application.WebApi.Modules
  12. {
  13. public class NewsApi : BaseApi
  14. {
  15. private NoticeIBLL noticeIBLL = new NoticeBLL();
  16. public NewsApi()
  17. : base("/learun/news")
  18. {
  19. Get["/list"] = GetList;
  20. }
  21. /// <summary>
  22. /// 获取页面显示列表数据
  23. /// <summary>
  24. /// <param name="_"></param>
  25. /// <returns></returns>
  26. public Response GetList(dynamic _)
  27. {
  28. var userinfo = LoginUserInfo.Get();
  29. Pagination paginationobj = new Pagination();
  30. var newsList = noticeIBLL.GetList("",(Request.Query["F_CategoryId"]!=null?Request.Query["F_CategoryId"].ToString():""));
  31. //var newsListOfSelf = new List<NewsEntity>();
  32. //foreach (var newsitemEntity in newsList)
  33. //{
  34. // if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  35. // {
  36. // if (!string.IsNullOrEmpty(userinfo.postIds))
  37. // {
  38. // if (userinfo.postIds.Contains(","))
  39. // {
  40. // foreach (var postid in userinfo.postIds.Split(','))
  41. // {
  42. // if (newsitemEntity.F_SendPostId.Contains(postid))
  43. // {
  44. // newsListOfSelf.Add(newsitemEntity);
  45. // break;
  46. // }
  47. // }
  48. // }
  49. // else
  50. // {
  51. // if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
  52. // {
  53. // newsListOfSelf.Add(newsitemEntity);
  54. // }
  55. // }
  56. // }
  57. // }
  58. // else
  59. // {
  60. // if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  61. // {
  62. // if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
  63. // {
  64. // newsListOfSelf.Add(newsitemEntity);
  65. // }
  66. // }
  67. // else
  68. // {
  69. // newsListOfSelf.Add(newsitemEntity);
  70. // }
  71. // }
  72. //}
  73. var jsonData = new
  74. {
  75. rows = newsList,
  76. total = newsList.Count,
  77. page = 0,
  78. records = newsList.Count
  79. };
  80. return Success(jsonData);
  81. }
  82. }
  83. }