Add query parameters to get posts v4 endpoint (#5858)

* Add since query paremeter to get posts v4 endpoint

* Add query paremeters for before/after to get posts v4 endpoint
Этот коммит содержится в:
Joram Wilander
2017-03-24 16:46:11 -04:00
коммит произвёл Corey Hulen
родитель 28a78d7607
Коммит 69fb47b88b
4 изменённых файлов: 214 добавлений и 11 удалений

Просмотреть файл

@@ -395,6 +395,22 @@ func GetPermalinkPost(postId string, userId string, siteURL string) (*model.Post
}
}
func GetPostsBeforePost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
if result := <-Srv.Store.Post().GetPostsBefore(channelId, postId, perPage, page*perPage); result.Err != nil {
return nil, result.Err
} else {
return result.Data.(*model.PostList), nil
}
}
func GetPostsAfterPost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
if result := <-Srv.Store.Post().GetPostsAfter(channelId, postId, perPage, page*perPage); result.Err != nil {
return nil, result.Err
} else {
return result.Data.(*model.PostList), nil
}
}
func GetPostsAroundPost(postId, channelId string, offset, limit int, before bool) (*model.PostList, *model.AppError) {
var pchan store.StoreChannel
if before {