Improving command line interface (#4689)

Этот коммит содержится в:
Christopher Speller
2016-12-06 10:49:34 -05:00
коммит произвёл GitHub
родитель dcf11a14d8
Коммит 026553e4f8
130 изменённых файлов: 16375 добавлений и 669 удалений

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

@@ -502,14 +502,29 @@ func (s SqlChannelStore) GetTeamChannels(teamId string) StoreChannel {
}
func (s SqlChannelStore) GetByName(teamId string, name string) StoreChannel {
return s.getByName(teamId, name, false)
}
func (s SqlChannelStore) GetByNameIncludeDeleted(teamId string, name string) StoreChannel {
return s.getByName(teamId, name, true)
}
func (s SqlChannelStore) getByName(teamId string, name string, includeDeleted bool) StoreChannel {
storeChannel := make(StoreChannel, 1)
var query string
if includeDeleted {
query = "SELECT * FROM Channels WHERE (TeamId = :TeamId OR TeamId = '') AND Name = :Name"
} else {
query = "SELECT * FROM Channels WHERE (TeamId = :TeamId OR TeamId = '') AND Name = :Name AND DeleteAt = 0"
}
go func() {
result := StoreResult{}
channel := model.Channel{}
if err := s.GetReplica().SelectOne(&channel, "SELECT * FROM Channels WHERE (TeamId = :TeamId OR TeamId = '') AND Name = :Name AND DeleteAt = 0", map[string]interface{}{"TeamId": teamId, "Name": name}); err != nil {
if err := s.GetReplica().SelectOne(&channel, query, map[string]interface{}{"TeamId": teamId, "Name": name}); err != nil {
if err == sql.ErrNoRows {
result.Err = model.NewLocAppError("SqlChannelStore.GetByName", MISSING_CHANNEL_ERROR, nil, "teamId="+teamId+", "+"name="+name+", "+err.Error())
} else {

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

@@ -89,7 +89,8 @@ type ChannelStore interface {
Delete(channelId string, time int64) StoreChannel
SetDeleteAt(channelId string, deleteAt int64, updateAt int64) StoreChannel
PermanentDeleteByTeam(teamId string) StoreChannel
GetByName(team_id string, domain string) StoreChannel
GetByName(team_id string, name string) StoreChannel
GetByNameIncludeDeleted(team_id string, name string) StoreChannel
GetChannels(teamId string, userId string) StoreChannel
GetMoreChannels(teamId string, userId string, offset int, limit int) StoreChannel
GetChannelCounts(teamId string, userId string) StoreChannel