Cleaning up old export code (#3601)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
b339b5c982
Коммит
942ae4c527
@@ -982,28 +982,6 @@ func (s SqlChannelStore) IncrementMentionCount(channelId string, userId string)
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) GetForExport(teamId string) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
var data []*model.Channel
|
||||
_, err := s.GetReplica().Select(&data, "SELECT * FROM Channels WHERE TeamId = :TeamId AND DeleteAt = 0 AND Type = 'O'", map[string]interface{}{"TeamId": teamId})
|
||||
|
||||
if err != nil {
|
||||
result.Err = model.NewLocAppError("SqlChannelStore.GetAllChannels", "store.sql_channel.get_for_export.app_error", nil, "teamId="+teamId+", err="+err.Error())
|
||||
} else {
|
||||
result.Data = data
|
||||
}
|
||||
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
}()
|
||||
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) GetAll(teamId string) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
|
||||
@@ -784,30 +784,6 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlPostStore) GetForExport(channelId string) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
var posts []*model.Post
|
||||
_, err := s.GetReplica().Select(
|
||||
&posts,
|
||||
"SELECT * FROM Posts WHERE ChannelId = :ChannelId AND DeleteAt = 0",
|
||||
map[string]interface{}{"ChannelId": channelId})
|
||||
if err != nil {
|
||||
result.Err = model.NewLocAppError("SqlPostStore.GetForExport", "store.sql_post.get_for_export.app_error", nil, "channelId="+channelId+err.Error())
|
||||
} else {
|
||||
result.Data = posts
|
||||
}
|
||||
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
}()
|
||||
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
|
||||
@@ -969,34 +969,6 @@ func (us SqlUserStore) VerifyEmail(userId string) StoreChannel {
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (us SqlUserStore) GetForExport(teamId string) StoreChannel {
|
||||
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
var users []*model.User
|
||||
|
||||
if _, err := us.GetReplica().Select(&users, "SELECT Users.* FROM Users, TeamMembers WHERE TeamMembers.TeamId = :TeamId AND Users.Id = TeamMembers.UserId", map[string]interface{}{"TeamId": teamId}); err != nil {
|
||||
result.Err = model.NewLocAppError("SqlUserStore.GetForExport", "store.sql_user.get_for_export.app_error", nil, err.Error())
|
||||
} else {
|
||||
for _, u := range users {
|
||||
u.Password = ""
|
||||
u.AuthData = new(string)
|
||||
*u.AuthData = ""
|
||||
}
|
||||
|
||||
result.Data = users
|
||||
}
|
||||
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
}()
|
||||
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (us SqlUserStore) GetTotalUsersCount() StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ type ChannelStore interface {
|
||||
GetChannels(teamId string, userId string) StoreChannel
|
||||
GetMoreChannels(teamId string, userId string) StoreChannel
|
||||
GetChannelCounts(teamId string, userId string) StoreChannel
|
||||
GetForExport(teamId string) StoreChannel
|
||||
GetAll(teamId string) StoreChannel
|
||||
|
||||
SaveMember(member *model.ChannelMember) StoreChannel
|
||||
@@ -117,7 +116,6 @@ type PostStore interface {
|
||||
GetPostsSince(channelId string, time int64) StoreChannel
|
||||
GetEtag(channelId string) StoreChannel
|
||||
Search(teamId string, userId string, params *model.SearchParams) StoreChannel
|
||||
GetForExport(channelId string) StoreChannel
|
||||
AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel
|
||||
AnalyticsPostCountsByDay(teamId string) StoreChannel
|
||||
AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) StoreChannel
|
||||
@@ -151,7 +149,6 @@ type UserStore interface {
|
||||
GetEtagForProfiles(teamId string) StoreChannel
|
||||
GetEtagForDirectProfiles(userId string) StoreChannel
|
||||
UpdateFailedPasswordAttempts(userId string, attempts int) StoreChannel
|
||||
GetForExport(teamId string) StoreChannel
|
||||
GetTotalUsersCount() StoreChannel
|
||||
GetTotalActiveUsersCount() StoreChannel
|
||||
GetSystemAdminProfiles() StoreChannel
|
||||
|
||||
Ссылка в новой задаче
Block a user