Add session, frontend and command services.
Этот коммит содержится в:
@@ -239,6 +239,8 @@ func NewChannels(services map[product.ServiceKey]any) (*Channels, error) {
|
||||
app: &App{ch: ch},
|
||||
}
|
||||
|
||||
services[product.CommandKey] = &App{ch: ch}
|
||||
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -253,6 +253,8 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
product.KVStoreKey: s.platform,
|
||||
product.StoreKey: store.NewStoreServiceAdapter(s.Store()),
|
||||
product.SystemKey: &systemServiceAdapter{server: s},
|
||||
product.SessionKey: app,
|
||||
product.FrontendKey: app,
|
||||
}
|
||||
|
||||
// Step 4: Initialize products.
|
||||
|
||||
@@ -231,3 +231,25 @@ type BoardsService interface {
|
||||
DeleteCard(cardID string, userID string) error
|
||||
HasPermissionToBoard(userID, boardID string, permission *model.Permission) bool
|
||||
}
|
||||
|
||||
// SessionService is the API for accessing the session.
|
||||
//
|
||||
// The service shall be registered via app.SessionKey service key.
|
||||
type SessionService interface {
|
||||
GetSessionById(sessionID string) (*model.Session, *model.AppError)
|
||||
}
|
||||
|
||||
// FrontendService is the API for interacting with front end.
|
||||
//
|
||||
// The service shall be registered via app.FrontendKey service key.
|
||||
type FrontendService interface {
|
||||
OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError
|
||||
}
|
||||
|
||||
// CommandService is the API for interacting with front end.
|
||||
//
|
||||
// The service shall be registered via app.CommandKey service key.
|
||||
type CommandService interface {
|
||||
ExecuteCommand(c request.CTX, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
|
||||
RegisterPluginCommand(pluginID string, command *model.Command) error
|
||||
}
|
||||
|
||||
@@ -26,4 +26,7 @@ const (
|
||||
SystemKey ServiceKey = "systemkey"
|
||||
PreferencesKey ServiceKey = "preferenceskey"
|
||||
BoardsKey ServiceKey = "boards"
|
||||
SessionKey ServiceKey = "sessionkey"
|
||||
FrontendKey ServiceKey = "frontendkey"
|
||||
CommandKey ServiceKey = "commandkey"
|
||||
)
|
||||
|
||||
Ссылка в новой задаче
Block a user