Add some group plugin APIs (#12180)
* Add group store GetByUser * Add group store GetByName * Add group plugin APIs * Minor naming fixes * Add minimum version comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fbf4d6d139
Коммит
9307f75fe9
@@ -11,6 +11,10 @@ func (a *App) GetGroup(id string) (*model.Group, *model.AppError) {
|
||||
return a.Srv.Store.Group().Get(id)
|
||||
}
|
||||
|
||||
func (a *App) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
return a.Srv.Store.Group().GetByName(name)
|
||||
}
|
||||
|
||||
func (a *App) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) {
|
||||
return a.Srv.Store.Group().GetByRemoteID(remoteID, groupSource)
|
||||
}
|
||||
@@ -19,6 +23,10 @@ func (a *App) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group,
|
||||
return a.Srv.Store.Group().GetAllBySource(groupSource)
|
||||
}
|
||||
|
||||
func (a *App) GetGroupsByUserId(userId string) ([]*model.Group, *model.AppError) {
|
||||
return a.Srv.Store.Group().GetByUser(userId)
|
||||
}
|
||||
|
||||
func (a *App) CreateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
||||
return a.Srv.Store.Group().Create(group)
|
||||
}
|
||||
|
||||
@@ -445,6 +445,18 @@ func (api *PluginAPI) DeleteChannelMember(channelId, userId string) *model.AppEr
|
||||
return api.app.LeaveChannel(channelId, userId)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetGroup(groupId string) (*model.Group, *model.AppError) {
|
||||
return api.app.GetGroup(groupId)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
return api.app.GetGroupByName(name)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetGroupsForUser(userId string) ([]*model.Group, *model.AppError) {
|
||||
return api.app.GetGroupsByUserId(userId)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError) {
|
||||
return api.app.CreatePostMissingChannel(post, true)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user