Esempio n. 1
0
        public async Task <ActionResult> ViewFeed(string userName, string feedName)
        {
            ViewBag.UserName = userName;
            ViewBag.FeedName = feedName;
            var feed = await feeds.Get(userName, feedName);

            if (feed == null)
            {
                return(View());
            }
            var feedPosts = await posts.GetForFeed(feed);

            ViewBag.Posts = Mapper.Map <IEnumerable <PostViewModel> >(feedPosts);
            return(View(feed));
        }
Esempio n. 2
0
 public async Task <IEnumerable <FeedItem> > Get([FromUri] DateTime dmin,
                                                 DateTime dmax, int?lmin, int?lmax, IEnumerable <int> ls, IEnumerable <int> ets,
                                                 int?c, int?r, string cf, IEnumerable <int> us, int?topN)
 {
     return(await Task.FromResult(Feeds.Get(dmin, dmax, lmin, lmax,
                                            ls, ets, c, r, cf, us, topN)));
 }
Esempio n. 3
0
        public void ForwardPluginEventToFeed()
        {
            int    courseId  = int.Parse(Context.QueryString["courseID"]);
            int    logId     = int.Parse(Context.QueryString["logID"]);
            int    userId    = int.Parse(Context.QueryString["userID"]);
            string eventType = Context.QueryString["eventType"];
            string authKey   = Context.QueryString["authKey"];

            var newPost = new AggregateFeedItem(Feeds.Get(logId));

            using (FeedController feedController = new FeedController())
            {
                NotifyNewPost(JObject.Parse(JsonConvert.SerializeObject(feedController.MakeAggregateFeedItemJsonObject(newPost, false, userId, courseId))), eventType, courseId, authKey);
            }
        }
Esempio n. 4
0
        public void TestGet()
        {
            var results = Feeds.Get(
                new DateTime(2014, 1, 1),
                new DateTime(2014, 2, 1),
                null,
                null,
                null,
                new List <int> {
                1, 2
            },
                null,
                null,
                null,
                null,
                20);

            Assert.IsNotNull(results);
            Assert.IsTrue(results.GetType() == typeof(List <FeedItem>));
        }