Пример #1
0
        protected override SearchRD ProcessRequest(DTO.Base.APIRequest <SearchRP> pRequest)
        {
            SearchRD rd   = new SearchRD();
            var      para = pRequest.Parameters;

            #region 获取数据,并更新了标签查询次数
            var bll     = new KnowledgeBLL(CurrentUserInfo);
            var entitys = bll.GetByParaAndUpdateTagSearchTimes(HttpUtility.UrlDecode(para.Key), para.PageIndex, para.PageSize, para.Type);
            var list    = entitys.OrderBy(t => t.DisplayIndex).Select(t => new KnowledgeListItemInfo
            {
                Author        = t.Author,
                ClickCount    = t.ClickCount,
                EvaluateCount = t.EvaluateCount,
                ID            = t.KnowIedgeId,
                KeepCount     = t.KeepCount,
                PraiseCount   = t.PraiseCount,
                ShareCount    = t.ShareCount,
                Title         = t.Title,
                TreadCount    = t.TreadCount
            });
            #endregion

            #region 增加查询记录
            var logbll    = new KnowledgeTagLogBLL(CurrentUserInfo);
            var logEntity = new KnowledgeTagLogEntity()
            {
                Keyword  = para.Key,
                VipId    = CurrentUserInfo.UserID,
                TagLogId = Guid.NewGuid()
            };
            logbll.Create(logEntity);
            #endregion

            rd.Knowledges = list.ToArray();
            return(rd);
        }
Пример #2
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(KnowledgeTagLogEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pTran);
 }
Пример #3
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(KnowledgeTagLogEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
Пример #4
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <KnowledgeTagLogEntity> PagedQueryByEntity(KnowledgeTagLogEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
Пример #5
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public KnowledgeTagLogEntity[] QueryByEntity(KnowledgeTagLogEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
Пример #6
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(KnowledgeTagLogEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
Пример #7
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(KnowledgeTagLogEntity pEntity)
 {
     _currentDAO.Update(pEntity);
 }