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.
Этот коммит содержится в:
George Goldberg
2018-09-17 15:51:26 +01:00
коммит произвёл GitHub
родитель 5786b0d6d5
Коммит ab99f0656f
24 изменённых файлов: 1106 добавлений и 46 удалений

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

@@ -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 {

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

@@ -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 "[]"

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

@@ -110,6 +110,19 @@ func (o *PostPatch) WithRewrittenImageURLs(f func(string) string) *PostPatch {
return &copy
}
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"`

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

@@ -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"`
}

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

@@ -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)