public override void Handle(object param) { ServerMessageServiceParam serviceParam = (ServerMessageServiceParam)param; var category = mCategoryDao.LoadCategory(long.Parse(serviceParam.Data.ToString()), 0, CategoryDao.MAXLIMIT); mMemoryCache.Set("ResponseCategoryContent", new CategoryDetailResponse { Category = category, Content = category.LinkContentList.ToArray() }); mIntentManager.AddIntent(ServiceType.Workflow, "RESPONSE_GETCATEGORYCONTENT", null); }
public override void Handle(object param) { ServerMessageServiceParam serviceParam = (ServerMessageServiceParam)param; var handlerParam = JsonConvert.DeserializeObject <GetCategoryParam> (serviceParam.Data.ToString()); var category = mCategoryDao.LoadCategory(handlerParam.CategoryId, handlerParam.OffsetSubCategory, handlerParam.LimitOffsetSubCategory); mMemoryCache.Set("ResponseCategory", new CategoryDetailResponse { Category = category, SubCategory = category.LinkSubCategoryList.ToArray(), Content = category.LinkContentList.ToArray() }); //this.mLogger.LogDebug(LoggingEvents.Undefine, "[Execute] Register RESPONSE_GETCATEGORY"); mIntentManager.AddIntent(ServiceType.Workflow, "RESPONSE_GETCATEGORY", null); }
public override void Handle(object param) { mLogger.Debug("IN - {@Param}", param); ServerMessageServiceParam paramObj = (ServerMessageServiceParam)param; var paramHandler = paramObj.Data as HandlerParameter; if (paramHandler.CategoryId.HasValue) { // カテゴリから関連するコンテント一覧を作成する場合 var category = mCategoryDao.LoadCategory(categoryId: paramHandler.CategoryId.Value, offsetContent: paramHandler.PageNo); var cacheEntryOptions = new MemoryCacheEntryOptions(); mMemoryCache.Set(cacheKey, new ContentListParam() { Category = category, ContentList = category.LinkContentList.ToArray() }, cacheEntryOptions); } else if (paramHandler.LabelId.HasValue) { // ラベルから関連するコンテント一覧を生成する場合 var label = mLabelDao.LoadLabel(paramHandler.LabelId.Value); var cacheEntryOptions = new MemoryCacheEntryOptions(); mMemoryCache.Set(cacheKey, new ContentListParam() { ContentList = label.LinkContentList.ToArray() }, cacheEntryOptions); } else { mLogger.Warn("コンテント一覧の取得ソースを指定してください。"); return; } mIntentManager.AddIntent(ServiceType.Workflow, "ACT_RESINVALIDATE_CONTENTLIST"); mLogger.Debug("OUT"); }