From ab99f0656fabed8a62a8c6340be7d538cc7bf8d9 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 17 Sep 2018 15:51:26 +0100 Subject: 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. --- app/import_types.go | 80 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'app/import_types.go') diff --git a/app/import_types.go b/app/import_types.go index 168d43bab..1a2e44018 100644 --- a/app/import_types.go +++ b/app/import_types.go @@ -9,24 +9,24 @@ import "github.com/mattermost/mattermost-server/model" type LineImportData struct { Type string `json:"type"` - Scheme *SchemeImportData `json:"scheme"` - Team *TeamImportData `json:"team"` - Channel *ChannelImportData `json:"channel"` - User *UserImportData `json:"user"` - Post *PostImportData `json:"post"` - DirectChannel *DirectChannelImportData `json:"direct_channel"` - DirectPost *DirectPostImportData `json:"direct_post"` - Emoji *EmojiImportData `json:"emoji"` - Version *int `json:"version"` + Scheme *SchemeImportData `json:"scheme,omitempty"` + Team *TeamImportData `json:"team,omitempty"` + Channel *ChannelImportData `json:"channel,omitempty"` + User *UserImportData `json:"user,omitempty"` + Post *PostImportData `json:"post,omitempty"` + DirectChannel *DirectChannelImportData `json:"direct_channel,omitempty"` + DirectPost *DirectPostImportData `json:"direct_post,omitempty"` + Emoji *EmojiImportData `json:"emoji,omitempty"` + Version *int `json:"version,omitempty"` } type TeamImportData struct { Name *string `json:"name"` DisplayName *string `json:"display_name"` Type *string `json:"type"` - Description *string `json:"description"` - AllowOpenInvite *bool `json:"allow_open_invite"` - Scheme *string `json:"scheme"` + Description *string `json:"description,omitempty"` + AllowOpenInvite *bool `json:"allow_open_invite,omitempty"` + Scheme *string `json:"scheme,omitempty"` } type ChannelImportData struct { @@ -34,38 +34,38 @@ type ChannelImportData struct { Name *string `json:"name"` DisplayName *string `json:"display_name"` Type *string `json:"type"` - Header *string `json:"header"` - Purpose *string `json:"purpose"` - Scheme *string `json:"scheme"` + Header *string `json:"header,omitempty"` + Purpose *string `json:"purpose,omitempty"` + Scheme *string `json:"scheme,omitempty"` } type UserImportData struct { - ProfileImage *string `json:"profile_image"` + ProfileImage *string `json:"profile_image,omitempty"` Username *string `json:"username"` Email *string `json:"email"` AuthService *string `json:"auth_service"` - AuthData *string `json:"auth_data"` - Password *string `json:"password"` + AuthData *string `json:"auth_data,omitempty"` + Password *string `json:"password,omitempty"` Nickname *string `json:"nickname"` FirstName *string `json:"first_name"` LastName *string `json:"last_name"` Position *string `json:"position"` Roles *string `json:"roles"` Locale *string `json:"locale"` - UseMarkdownPreview *string `json:"feature_enabled_markdown_preview"` - UseFormatting *string `json:"formatting"` - ShowUnreadSection *string `json:"show_unread_section"` + UseMarkdownPreview *string `json:"feature_enabled_markdown_preview,omitempty"` + UseFormatting *string `json:"formatting,omitempty"` + ShowUnreadSection *string `json:"show_unread_section,omitempty"` - Teams *[]UserTeamImportData `json:"teams"` + Teams *[]UserTeamImportData `json:"teams,omitempty"` - Theme *string `json:"theme"` - UseMilitaryTime *string `json:"military_time"` - CollapsePreviews *string `json:"link_previews"` - MessageDisplay *string `json:"message_display"` - ChannelDisplayMode *string `json:"channel_display_mode"` - TutorialStep *string `json:"tutorial_step"` + Theme *string `json:"theme,omitempty"` + UseMilitaryTime *string `json:"military_time,omitempty"` + CollapsePreviews *string `json:"link_previews,omitempty"` + MessageDisplay *string `json:"message_display,omitempty"` + ChannelDisplayMode *string `json:"channel_display_mode,omitempty"` + TutorialStep *string `json:"tutorial_step,omitempty"` - NotifyProps *UserNotifyPropsImportData `json:"notify_props"` + NotifyProps *UserNotifyPropsImportData `json:"notify_props,omitempty"` } type UserNotifyPropsImportData struct { @@ -85,15 +85,15 @@ type UserNotifyPropsImportData struct { type UserTeamImportData struct { Name *string `json:"name"` Roles *string `json:"roles"` - Theme *string `json:"theme"` - Channels *[]UserChannelImportData `json:"channels"` + Theme *string `json:"theme,omitempty"` + Channels *[]UserChannelImportData `json:"channels,omitempty"` } type UserChannelImportData struct { Name *string `json:"name"` Roles *string `json:"roles"` - NotifyProps *UserChannelNotifyPropsImportData `json:"notify_props"` - Favorite *bool `json:"favorite"` + NotifyProps *UserChannelNotifyPropsImportData `json:"notify_props,omitempty"` + Favorite *bool `json:"favorite,omitempty"` } type UserChannelNotifyPropsImportData struct { @@ -119,9 +119,9 @@ type ReplyImportData struct { Message *string `json:"message"` CreateAt *int64 `json:"create_at"` - FlaggedBy *[]string `json:"flagged_by"` - Reactions *[]ReactionImportData `json:"reactions"` - Attachments *[]AttachmentImportData `json:"attachments"` + FlaggedBy *[]string `json:"flagged_by,omitempty"` + Reactions *[]ReactionImportData `json:"reactions,omitempty"` + Attachments *[]AttachmentImportData `json:"attachments,omitempty"` } type PostImportData struct { @@ -132,10 +132,10 @@ type PostImportData struct { Message *string `json:"message"` CreateAt *int64 `json:"create_at"` - FlaggedBy *[]string `json:"flagged_by"` - Reactions *[]ReactionImportData `json:"reactions"` - Replies *[]ReplyImportData `json:"replies"` - Attachments *[]AttachmentImportData `json:"attachments"` + FlaggedBy *[]string `json:"flagged_by,omitempty"` + Reactions *[]ReactionImportData `json:"reactions,omitempty"` + Replies *[]ReplyImportData `json:"replies,omitempty"` + Attachments *[]AttachmentImportData `json:"attachments,omitempty"` } type DirectChannelImportData struct { -- cgit v1.2.3-1-g7c22