/// <summary> /// 命令执行 /// </summary> /// <param name="context"></param> public override void Execute(DataContext context) { byte[] cmdData = context.CmdData; if (cmdData.Length == 0) { context.Flush(RespondCode.CmdDataLack); return; } TopicQuery query = cmdData.ProtoBufDeserialize<TopicQuery>(); if (Compiled.Debug) query.Debug("=== Bbs.QueryUserTopic 上行数据 ==="); if (query.OwnerId == 0 || query.OwnerId == context.UserId) { context.Flush(RespondCode.DataInvalid); return; } query.AttachContent = string.Empty; query.ForumId = 0; query.HasBestAnswer = true; query.Keyword = string.Empty; query.OrderType = OrderType.Default; UserCacheInfo userCache = UserBiz.ReadUserCacheInfo(context.UserId); TopicQueryConditions condition = new TopicQueryConditions(userCache.UserSite, query, 1); PageResult<TopicInfo> pageResult = BbsBiz.GetPageTopicList(condition, query.QueryIndex, query.QuerySize); //TopicList topicList = pageResult.ToTopicList(); context.Flush<TopicList>(pageResult.ToTopicList()); }
/// <summary> /// 命令执行 /// </summary> /// <param name="context"></param> public override void Execute(DataContext context) { byte[] cmdData = context.CmdData; if (cmdData.Length == 0) { context.Flush(RespondCode.CmdDataLack); return; } TopicQuery query = cmdData.ProtoBufDeserialize <TopicQuery>(); if (Compiled.Debug) { query.Debug("=== Bbs.QueryMyRepliedTopic 上行数据 ==="); } PageResult <TopicInfo> pageResult = BbsBiz.GetUserRepliedTopicPageList(context.UserId, query.QueryIndex, query.QuerySize); context.Flush <TopicList>(pageResult.ToTopicList()); }
/// <summary> /// 命令执行 /// </summary> /// <param name="context"></param> public override void Execute(DataContext context) { byte[] cmdData = context.CmdData; if (cmdData.Length == 0) { context.Flush(RespondCode.CmdDataLack); return; } TopicQuery query = cmdData.ProtoBufDeserialize <TopicQuery>(); if (Compiled.Debug) { query.Debug("=== Bbs.QueryTopic 上行数据 ==="); } UserCacheInfo userCache = UserBiz.ReadUserCacheInfo(context.UserId); TopicQueryConditions condition = new TopicQueryConditions(userCache.UserSite, query, 1); PageResult <TopicInfo> pageResult = BbsBiz.GetPageTopicList(condition, query.QueryIndex, query.QuerySize); //TopicList topicList = pageResult.ToTopicList(); context.Flush <TopicList>(pageResult.ToTopicList()); }