Refactor Get/Create Direct Channel into one function (#9867)

* refactor GetDirectChannel and CreateDirectChannel in one function

* remove CreateDirectChannel plugin api and update GetDirectChannel and GetGroupChannel plugin api

* update tests
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-11-28 18:01:49 +01:00
коммит произвёл GitHub
родитель 09eae76c00
Коммит 1bcf08aa4b
18 изменённых файлов: 241 добавлений и 402 удалений

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

@@ -112,31 +112,6 @@ func (_m *API) CreateChannel(channel *model.Channel) (*model.Channel, *model.App
return r0, r1
}
// CreateDirectChannel provides a mock function with given fields: userId1, userId2
func (_m *API) CreateDirectChannel(userId1 string, userId2 string) (*model.Channel, *model.AppError) {
ret := _m.Called(userId1, userId2)
var r0 *model.Channel
if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok {
r0 = rf(userId1, userId2)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Channel)
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
r1 = rf(userId1, userId2)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// CreatePost provides a mock function with given fields: post
func (_m *API) CreatePost(post *model.Post) (*model.Post, *model.AppError) {
ret := _m.Called(post)
@@ -606,20 +581,6 @@ func (_m *API) GetConfig() *model.Config {
return r0
}
// GetPluginConfig provides a mock function with given fields:
func (_m *API) GetPluginConfig() map[string]interface{} {
ret := _m.Called()
var r0 map[string]interface{}
if rf, ok := ret.Get(0).(func() map[string]interface{}); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(map[string]interface{})
}
return r0
}
// GetDirectChannel provides a mock function with given fields: userId1, userId2
func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, *model.AppError) {
ret := _m.Called(userId1, userId2)
@@ -850,6 +811,22 @@ func (_m *API) GetLDAPUserAttributes(userId string, attributes []string) (map[st
return r0, r1
}
// GetPluginConfig provides a mock function with given fields:
func (_m *API) GetPluginConfig() map[string]interface{} {
ret := _m.Called()
var r0 map[string]interface{}
if rf, ok := ret.Get(0).(func() map[string]interface{}); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]interface{})
}
}
return r0
}
// GetPluginStatus provides a mock function with given fields: id
func (_m *API) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) {
ret := _m.Called(id)
@@ -1890,13 +1867,13 @@ func (_m *API) SaveConfig(config *model.Config) *model.AppError {
return r0
}
// SavePluginConfig provides a mock function with given fields: pluginConfig
func (_m *API) SavePluginConfig(pluginConfig map[string]interface{}) *model.AppError {
ret := _m.Called(pluginConfig)
// SavePluginConfig provides a mock function with given fields: config
func (_m *API) SavePluginConfig(config map[string]interface{}) *model.AppError {
ret := _m.Called(config)
var r0 *model.AppError
if rf, ok := ret.Get(0).(func(map[string]interface{}) *model.AppError); ok {
r0 = rf(pluginConfig)
r0 = rf(config)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.AppError)