Esempio n. 1
0
        public async Task <ActionResult <CommonPutResponse> > Put([GeneralTimelineName] string timeline)
        {
            var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);

            var create = await _service.AddHighlightTimelineAsync(timelineId, GetUserId());

            return(CommonPutResponse.Create(create));
        }
Esempio n. 2
0
        public async Task <ActionResult <HttpTimeline> > TimelineGet([FromRoute][GeneralTimelineName] string timeline)
        {
            var timelineId = await _service.GetTimelineIdByNameAsync(timeline);

            var t = await _service.GetTimelineAsync(timelineId);

            var result = await Map(t);

            return(result);
        }
Esempio n. 3
0
        public async Task <ActionResult <List <HttpTimelinePost> > > List([FromRoute][GeneralTimelineName] string timeline, [FromQuery] DateTime?modifiedSince, [FromQuery] bool?includeDeleted)
        {
            var timelineId = await _timelineService.GetTimelineIdByNameAsync(timeline);

            if (!UserHasAllTimelineManagementPermission && !await _timelineService.HasReadPermissionAsync(timelineId, GetOptionalUserId()))
            {
                return(ForbidWithCommonResponse());
            }

            var posts = await _postService.GetPostsAsync(timelineId, modifiedSince, includeDeleted ?? false);

            var result = await Map(posts);

            return(result);
        }