|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using Learun.Application.AppMagager;
- using Learun.Util;
- using Nancy;
- using System.Collections.Generic;
- using System.Linq;
- using Learun.Application.Base.SystemModule;
- using Learun.Application.TwoDevelopment.LR_Desktop;
- using System.Text;
- using System.Data;
- using Learun.Application.OA;
-
- namespace Learun.Application.WebApi.Modules
- {
-
- public class NewsApi : BaseApi
- {
- private NoticeIBLL noticeIBLL = new NoticeBLL();
-
- public NewsApi()
- : base("/learun/news")
- {
- Get["/list"] = GetList;
- }
-
-
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response GetList(dynamic _)
- {
- var userinfo = LoginUserInfo.Get();
- Pagination paginationobj = new Pagination();
- var newsList = noticeIBLL.GetList("",(Request.Query["F_CategoryId"]!=null?Request.Query["F_CategoryId"].ToString():""));
- //var newsListOfSelf = new List<NewsEntity>();
-
- //foreach (var newsitemEntity in newsList)
- //{
- // if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
- // {
- // if (!string.IsNullOrEmpty(userinfo.postIds))
- // {
- // if (userinfo.postIds.Contains(","))
- // {
- // foreach (var postid in userinfo.postIds.Split(','))
- // {
- // if (newsitemEntity.F_SendPostId.Contains(postid))
- // {
- // newsListOfSelf.Add(newsitemEntity);
- // break;
- // }
- // }
- // }
- // else
- // {
- // if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
- // {
- // newsListOfSelf.Add(newsitemEntity);
- // }
- // }
- // }
- // }
- // else
- // {
- // if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
- // {
- // if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
- // {
- // newsListOfSelf.Add(newsitemEntity);
- // }
- // }
- // else
- // {
- // newsListOfSelf.Add(newsitemEntity);
- // }
- // }
- //}
- var jsonData = new
- {
- rows = newsList,
- total = newsList.Count,
- page = 0,
- records = newsList.Count
- };
- return Success(jsonData);
- }
-
- }
-
- }
|