MM-17468 - Improving performance of fetching threads (#11980)

fetchThreads parameter support in the API
Этот коммит содержится в:
Eli Yukelzon
2019-09-17 14:37:10 +01:00
коммит произвёл GitHub
родитель 39036ffb30
Коммит b3517eaf2f
14 изменённых файлов: 457 добавлений и 235 удалений

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

@@ -73,7 +73,6 @@ type Post struct {
OriginalId string `json:"original_id"`
Message string `json:"message"`
// MessageSource will contain the message as submitted by the user if Message has been modified
// by Mattermost for presentation (e.g if an image proxy is being used). It should be used to
// populate edit boxes if present.
@@ -88,7 +87,8 @@ type Post struct {
HasReactions bool `json:"has_reactions,omitempty"`
// Transient data populated before sending a post to the client
Metadata *PostMetadata `json:"metadata,omitempty" db:"-"`
ReplyCount int64 `json:"reply_count" db:"-"`
Metadata *PostMetadata `json:"metadata,omitempty" db:"-"`
}
type PostEphemeral struct {
@@ -170,6 +170,20 @@ func (o *Post) ToUnsanitizedJson() string {
return string(b)
}
type GetPostsSinceOptions struct {
ChannelId string
Time int64
SkipFetchThreads bool
}
type GetPostsOptions struct {
ChannelId string
PostId string
Page int
PerPage int
SkipFetchThreads bool
}
func PostFromJson(data io.Reader) *Post {
var o *Post
json.NewDecoder(data).Decode(&o)