diff options
author | George Goldberg <george@gberg.me> | 2018-09-17 15:51:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 15:51:26 +0100 |
commit | ab99f0656fabed8a62a8c6340be7d538cc7bf8d9 (patch) | |
tree | bb68ee1d0c743be23bba470f5d81ef11dc134182 /model | |
parent | 5786b0d6d57b90bbb0c262235dd9d19b497b5fae (diff) | |
download | chat-ab99f0656fabed8a62a8c6340be7d538cc7bf8d9.tar.gz chat-ab99f0656fabed8a62a8c6340be7d538cc7bf8d9.tar.bz2 chat-ab99f0656fabed8a62a8c6340be7d538cc7bf8d9.zip |
MM-11781: Basic Data Export Command Line. (#9296)
* MM-11781: Basic Data Export Command Line.
* ChannelStore new unit tests.
* TeamStore new unit tests.
* Unit test for new UserStore function.
* Unit tests for post store new methods.
* Review fixes.
* Fix duplicate command name.
Diffstat (limited to 'model')
-rw-r--r-- | model/channel.go | 6 | ||||
-rw-r--r-- | model/channel_member.go | 5 | ||||
-rw-r--r-- | model/post.go | 13 | ||||
-rw-r--r-- | model/team.go | 5 | ||||
-rw-r--r-- | model/team_member.go | 5 |
5 files changed, 34 insertions, 0 deletions
diff --git a/model/channel.go b/model/channel.go index 09e5e389c..529c49d35 100644 --- a/model/channel.go +++ b/model/channel.go @@ -57,6 +57,12 @@ type ChannelPatch struct { Purpose *string `json:"purpose"` } +type ChannelForExport struct { + Channel + TeamName string + SchemeName *string +} + func (o *Channel) DeepCopy() *Channel { copy := *o if copy.SchemeId != nil { diff --git a/model/channel_member.go b/model/channel_member.go index 709ad3ccd..941db62f7 100644 --- a/model/channel_member.go +++ b/model/channel_member.go @@ -43,6 +43,11 @@ type ChannelMember struct { type ChannelMembers []ChannelMember +type ChannelMemberForExport struct { + ChannelMember + ChannelName string +} + func (o *ChannelMembers) ToJson() string { if b, err := json.Marshal(o); err != nil { return "[]" diff --git a/model/post.go b/model/post.go index d903156eb..0df698279 100644 --- a/model/post.go +++ b/model/post.go @@ -110,6 +110,19 @@ func (o *PostPatch) WithRewrittenImageURLs(f func(string) string) *PostPatch { return © } +type PostForExport struct { + Post + TeamName string + ChannelName string + Username string + ReplyCount int +} + +type ReplyForExport struct { + Post + Username string +} + type PostForIndexing struct { Post TeamId string `json:"team_id"` diff --git a/model/team.go b/model/team.go index 530c3fd6a..eadd05225 100644 --- a/model/team.go +++ b/model/team.go @@ -52,6 +52,11 @@ type TeamPatch struct { AllowOpenInvite *bool `json:"allow_open_invite"` } +type TeamForExport struct { + Team + SchemeName *string +} + type Invites struct { Invites []map[string]string `json:"invites"` } diff --git a/model/team_member.go b/model/team_member.go index 0bda96121..3bae3d7e9 100644 --- a/model/team_member.go +++ b/model/team_member.go @@ -26,6 +26,11 @@ type TeamUnread struct { MentionCount int64 `json:"mention_count"` } +type TeamMemberForExport struct { + TeamMember + TeamName string +} + func (o *TeamMember) ToJson() string { b, _ := json.Marshal(o) return string(b) |