public long Count( string key, object value) { IndexContract.ValidateCount(key, value); return(RawIndex.Count(key, value)); }
public IEnumerable <IElement> Get(string key, object value) { IndexContract.ValidateGet(key, value); if (typeof(IVertex).IsAssignableFrom(Type)) { return(new EventVertexIterable((IEnumerable <IVertex>)RawIndex.Get(key, value), _eventGraph)); } return(new EventEdgeIterable((IEnumerable <IEdge>)RawIndex.Get(key, value), _eventGraph)); }
/// <summary> /// 获取首页加载需要的信息 /// </summary> /// <returns></returns> public ActionResult GetIndexData() { identity = IdentityManager.GetIdentFromAll(); if (identity.UserId == null) { return(DataProcess.Failure().ToMvcJson()); } return(IndexContract.GetIndexInfo(identity.UserId).ToMvcJson("yyyy-MM-dd HH:mm:ss")); //return IndexContract.GetIndexInfo(identity.UserId).ToMvcJson("yyyy-MM-dd HH:mm:ss"); }
public void Put(string key, object value, IElement element) { IndexContract.ValidatePut(key, value, element); var wrappedElement = element as WrappedElement; if (wrappedElement != null) { RawIndex.Put(key, value, wrappedElement.Element); } }
public void Put(string key, object value, IElement element) { IndexContract.ValidatePut(key, value, element); var eventElement = element as EventElement; if (eventElement != null) { RawIndex.Put(key, value, eventElement.GetBaseElement()); } }
public void Remove(string key, object value, IElement element) { IndexContract.ValidateRemove(key, value, element); var partitionElement = element as PartitionElement; if (partitionElement != null) { RawIndex.Remove(key, value, partitionElement.GetBaseElement()); } }
//获取对应类型帖子的数量 //posttype 0-综合 1-提问 2-分享 3-讨论 4-建议 5-公告 6-动态 //poststate 0-综合 1-未结 2-已结 3-精华 public int GetCountByType(int PostType, int PostState) { DataResult dp = IndexContract.GetCountByType(PostType, PostState); if (dp.Success) { return((int)dp.Data); } else { return(0); } }
//获取不同种类、不同状态、不同排序模式的帖子 public ActionResult GetPostBySyn(int PostType, int PostState, int SearchMode, int Curr, int Limit) { Curr = Curr - 1; return(IndexContract.GetPostBySyn(PostType, PostState, SearchMode, Curr, Limit).ToMvcJson("yyyy-MM-dd HH:mm:ss")); }
/// <summary> /// 获取热议文章 /// </summary> /// <returns></returns> public ActionResult GetHotPoasts() { return(IndexContract.GetHotPoasts().ToMvcJson()); }
public void Remove(string key, object value, IElement element) { IndexContract.ValidateRemove(key, value, element); BaseIndex.Remove(key, value, GetBaseElement(element)); }
public IEnumerable <IElement> Get(string key, object value) { IndexContract.ValidateGet(key, value); return(new IdEdgeIterable(BaseIndex.Get(key, value), IdGraph)); }
/// <summary> /// 获取综合帖子 /// </summary> /// <returns></returns> public ActionResult GetIndexPost(int Curr, int Limit, int Type = 0) { return(IndexContract.GetIndexPost(Curr, Limit, Type).ToMvcJson("yyyy-MM-dd HH:mm:ss")); }
public IEnumerable <IElement> Get(string key, object value) { IndexContract.ValidateGet(key, value); return(new IdVertexIterable(_baseIndex.Get(key, value), _idGraph)); }
public long Count(string key, object value) { IndexContract.ValidateCount(key, value); return(Get(key, value).LongCount()); }
public IEnumerable <IElement> Get(string key, object value) { IndexContract.ValidateGet(key, value); return(RawIndex.Get(key, value)); }
/// <summary> /// 获取置顶帖子 /// </summary> /// <returns></returns> public ActionResult GetIndexTopPost() { return(IndexContract.GetIndexTopPost().ToMvcJson("yyyy-MM-dd HH:mm:ss")); }
public void Put(string key, object value, IElement element) { IndexContract.ValidatePut(key, value, element); BaseIndex.Put(key, value, GetBaseElement(element)); }
/// <summary> /// 获取回帖周榜 /// </summary> /// <returns></returns> public ActionResult GetAnswerRank() { return(IndexContract.GetAnswerRank().ToMvcJson("yyyy-MM-dd HH:mm:ss")); }
public void Remove(string key, object value, IElement element) { IndexContract.ValidateRemove(key, value, element); throw new InvalidOperationException(ReadOnlyTokens.MutateErrorMessage); }