Parcourir la source

Merge branch '塔里木分支' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 塔里木分支

新疆体育高职分支
yxq il y a 1 an
Parent
révision
114c4c652e
1 fichiers modifiés avec 38 ajouts et 1 suppressions
  1. +38
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs

+ 38
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs Voir le fichier

@@ -1,4 +1,5 @@
using Learun.Application.AppMagager;
using System;
using Learun.Application.AppMagager;
using Learun.Util;
using Nancy;
using System.Collections.Generic;
@@ -15,6 +16,7 @@ namespace Learun.Application.WebApi.Modules
public class NewsApi : BaseApi
{
private NoticeIBLL noticeIBLL = new NoticeBLL();
LR_OA_NewsReadIBLL lR_OA_NewsReadIBLL=new LR_OA_NewsReadBLL();

public NewsApi()
: base("/learun/news")
@@ -22,6 +24,41 @@ namespace Learun.Application.WebApi.Modules
Get["/list"] = GetList;
}

#region 私有类
private class NoticeEntity
{
public string ProgressId { get; set; }
public string newsId { get; set; }
}
#endregion
/// <summary>
/// 阅读通知公告
/// <summary>
/// <returns></returns>
public Response NewsRead(dynamic _)
{
var loginUserInfo = LoginUserInfo.Get();
NoticeEntity parameter = this.GetReqData<NoticeEntity>();

//判断当前用户是否阅读当前通知公告
var entity = lR_OA_NewsReadIBLL.GetLR_OA_NewsReadEntityByNewsIdAndUserId(parameter.newsId, loginUserInfo.userId);
if (entity == null)
{
var lR_OA_NewsRead = new LR_OA_NewsReadEntity()
{
NewsId = parameter.newsId,
RUserId = loginUserInfo.userId,
RUserName = loginUserInfo.realName,
RTime = DateTime.Now
};
lR_OA_NewsReadIBLL.SaveEntity("", lR_OA_NewsRead);

//修改当前通知公告的浏览量
lR_OA_NewsReadIBLL.UpdateNewsPV(parameter.newsId);
}

return Success("阅读成功!");
}

/// <summary>
/// 获取页面显示列表数据


Chargement…
Annuler
Enregistrer