Add system service for Focalboard multi product architecture (#20574)
* add system service; add GetUsers to users service * add feature flag
Этот коммит содержится в:
@@ -173,3 +173,12 @@ func (a *App) SetServer(srv *Server) {
|
||||
func (a *App) UpdateExpiredDNDStatuses() ([]*model.Status, error) {
|
||||
return a.Srv().Store.Status().UpdateExpiredDNDStatuses()
|
||||
}
|
||||
|
||||
// systemServiceAdapter provides a collection of system APIs for use by products.
|
||||
type systemServiceAdapter struct {
|
||||
server *Server
|
||||
}
|
||||
|
||||
func (ssa *systemServiceAdapter) GetDiagnosticId() string {
|
||||
return ssa.server.TelemetryId()
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ const (
|
||||
HooksKey ServiceKey = "hooks"
|
||||
KVStoreKey ServiceKey = "kvstore"
|
||||
StoreKey ServiceKey = "storekey"
|
||||
SystemKey ServiceKey = "systemkey"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@@ -404,6 +405,7 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
CloudKey: &cloudWrapper{cloud: s.Cloud},
|
||||
KVStoreKey: &kvStoreWrapper{srv: s},
|
||||
StoreKey: store.NewStoreServiceAdapter(s.Store),
|
||||
SystemKey: &systemServiceAdapter{server: s},
|
||||
}
|
||||
|
||||
// Step 8: Initialize products.
|
||||
|
||||
@@ -34,11 +34,11 @@ type teamServiceWrapper struct {
|
||||
app AppIface
|
||||
}
|
||||
|
||||
func (w *teamServiceWrapper) GetMember(teamID, userID string) (*model.TeamMember, error) {
|
||||
func (w *teamServiceWrapper) GetMember(teamID, userID string) (*model.TeamMember, *model.AppError) {
|
||||
return w.app.GetTeamMember(teamID, userID)
|
||||
}
|
||||
|
||||
func (w *teamServiceWrapper) CreateMember(ctx *request.Context, teamID, userID string) (*model.TeamMember, error) {
|
||||
func (w *teamServiceWrapper) CreateMember(ctx *request.Context, teamID, userID string) (*model.TeamMember, *model.AppError) {
|
||||
return w.app.AddTeamMember(ctx, teamID, userID)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user