diff options
author | crupest <crupest@outlook.com> | 2022-04-12 17:36:34 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-12 17:36:34 +0800 |
commit | 3fc0cd57711b41e3a65e24e30ceaa3f95d7d4415 (patch) | |
tree | cf694d961ed67329d7b040db3f64fa72469dd827 /BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs | |
parent | da0f0abb3d5b2941e2e7c545ec8faf681c26e72a (diff) | |
download | timeline-3fc0cd57711b41e3a65e24e30ceaa3f95d7d4415.tar.gz timeline-3fc0cd57711b41e3a65e24e30ceaa3f95d7d4415.tar.bz2 timeline-3fc0cd57711b41e3a65e24e30ceaa3f95d7d4415.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs b/BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs index 435ffece..c80cda17 100644 --- a/BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs +++ b/BackEnd/Timeline/Controllers/TimelinePostV2Controller.cs @@ -43,14 +43,15 @@ namespace Timeline.Controllers [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status422UnprocessableEntity)] - public async Task<ActionResult<Page<HttpTimelinePost>>> ListAsync([FromRoute][Username] string owner, [FromRoute][TimelineName] string timeline, [FromQuery] DateTime? modifiedSince, [FromQuery][Range(0, int.MaxValue)] int? page, [FromQuery][Range(1, int.MaxValue)] int? numberPerPage) + public async Task<ActionResult<Page<HttpTimelinePost>>> ListAsync([FromRoute][Username] string owner, [FromRoute][TimelineName] string timeline, [FromQuery] DateTime? modifiedSince, + [FromQuery][PositiveInteger] int? page, [FromQuery][PositiveInteger] int? pageSize) { var timelineId = await _timelineService.GetTimelineIdAsync(owner, timeline); if (!UserHasPermission(UserPermission.AllTimelineManagement) && !await _timelineService.HasReadPermissionAsync(timelineId, GetOptionalAuthUserId())) { return Forbid(); } - var postPage = await _postService.GetPostsV2Async(timelineId, modifiedSince, page, numberPerPage); + var postPage = await _postService.GetPostsV2Async(timelineId, modifiedSince, page, pageSize); var items = await _mapper.MapListAsync<HttpTimelinePost>(postPage.Items, Url, User); return postPage.WithItems(items); } |