コード例 #1
0
        public async Task <ViewModel.ServiceResult> PostEditRss([FromBody] ViewModel.ContentManager.RssVM model)
        {
            try
            {
                var res = await ContentManagerRepository.EditRss(new Models.ContentManager.Rss()
                {
                    _id        = model._id,
                    title      = model.title,
                    url        = model.url,
                    siteid     = model.siteid,
                    lang       = model.lang,
                    tags       = model.tags,
                    categories = model.categories
                });

                if (res)
                {
                    return new ViewModel.ServiceResult()
                           {
                               ServiceResultStatus  = (int)Rdio.Util.Common.ServiceResultStatus.OK,
                               ServiceResultMassage = Util.Common.ServiceResultMessage.OKMessage.ToString()
                           }
                }
                ;
                else
                {
                    return new ViewModel.ServiceResult()
                           {
                               ServiceResultStatus  = (int)Rdio.Util.Common.ServiceResultStatus.Error,
                               ServiceResultMassage = Util.Common.ServiceResultMessage.FaildMessage.ToString()
                           }
                };
            }
            catch (Exception ex)
            {
                return(new ViewModel.ServiceResult()
                {
                    ServiceResultStatus = (int)Rdio.Util.Common.ServiceResultStatus.Error,
                    ServiceResultMassage = ex.GetBaseException().Message
                });
            }
        }
コード例 #2
0
        public async Task <ActionResult> RssManage(string id, string siteid)
        {
            var siteModel = await ContentManagerRepository.SiteInfo(siteid);

            var rssModel = await ContentManagerRepository.RssInfo(id);

            var model = new ViewModel.ContentManager.RssVM()
            {
                sitetitle  = siteModel.title,
                siteid     = siteModel._id,
                categories = rssModel.categories,
                tags       = rssModel.tags,
                lang       = rssModel.lang,
                title      = rssModel.title,
                url        = rssModel.url,
                userid     = rssModel.userid,
                _id        = rssModel._id
            };

            return(View(model));
        }