mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
d33b4918cd
commit
9dc82606db
@ -10,7 +10,6 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/services/login"
|
"github.com/grafana/grafana/pkg/services/login"
|
||||||
"github.com/grafana/grafana/pkg/services/org"
|
"github.com/grafana/grafana/pkg/services/org"
|
||||||
"github.com/grafana/grafana/pkg/services/quota"
|
"github.com/grafana/grafana/pkg/services/quota"
|
||||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
|
||||||
"github.com/grafana/grafana/pkg/services/user"
|
"github.com/grafana/grafana/pkg/services/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,7 +18,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func ProvideService(
|
func ProvideService(
|
||||||
sqlStore sqlstore.Store,
|
|
||||||
userService user.Service,
|
userService user.Service,
|
||||||
quotaService quota.Service,
|
quotaService quota.Service,
|
||||||
authInfoService login.AuthInfoService,
|
authInfoService login.AuthInfoService,
|
||||||
@ -27,7 +25,6 @@ func ProvideService(
|
|||||||
orgService org.Service,
|
orgService org.Service,
|
||||||
) *Implementation {
|
) *Implementation {
|
||||||
s := &Implementation{
|
s := &Implementation{
|
||||||
SQLStore: sqlStore,
|
|
||||||
userService: userService,
|
userService: userService,
|
||||||
QuotaService: quotaService,
|
QuotaService: quotaService,
|
||||||
AuthInfoService: authInfoService,
|
AuthInfoService: authInfoService,
|
||||||
@ -38,7 +35,6 @@ func ProvideService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Implementation struct {
|
type Implementation struct {
|
||||||
SQLStore sqlstore.Store
|
|
||||||
userService user.Service
|
userService user.Service
|
||||||
AuthInfoService login.AuthInfoService
|
AuthInfoService login.AuthInfoService
|
||||||
QuotaService quota.Service
|
QuotaService quota.Service
|
||||||
@ -49,7 +45,7 @@ type Implementation struct {
|
|||||||
|
|
||||||
// CreateUser creates inserts a new one.
|
// CreateUser creates inserts a new one.
|
||||||
func (ls *Implementation) CreateUser(cmd user.CreateUserCommand) (*user.User, error) {
|
func (ls *Implementation) CreateUser(cmd user.CreateUserCommand) (*user.User, error) {
|
||||||
return ls.SQLStore.CreateUser(context.Background(), cmd)
|
return ls.userService.Create(context.Background(), &cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpsertUser updates an existing user, or if it doesn't exist, inserts a new one.
|
// UpsertUser updates an existing user, or if it doesn't exist, inserts a new one.
|
||||||
|
@ -28,7 +28,6 @@ func Test_syncOrgRoles_doesNotBreakWhenTryingToRemoveLastOrgAdmin(t *testing.T)
|
|||||||
login := Implementation{
|
login := Implementation{
|
||||||
QuotaService: quotatest.New(false, nil),
|
QuotaService: quotatest.New(false, nil),
|
||||||
AuthInfoService: authInfoMock,
|
AuthInfoService: authInfoMock,
|
||||||
SQLStore: nil,
|
|
||||||
userService: usertest.NewUserServiceFake(),
|
userService: usertest.NewUserServiceFake(),
|
||||||
orgService: orgtest.NewOrgServiceFake(),
|
orgService: orgtest.NewOrgServiceFake(),
|
||||||
}
|
}
|
||||||
@ -53,7 +52,6 @@ func Test_syncOrgRoles_whenTryingToRemoveLastOrgLogsError(t *testing.T) {
|
|||||||
login := Implementation{
|
login := Implementation{
|
||||||
QuotaService: quotatest.New(false, nil),
|
QuotaService: quotatest.New(false, nil),
|
||||||
AuthInfoService: authInfoMock,
|
AuthInfoService: authInfoMock,
|
||||||
SQLStore: nil,
|
|
||||||
userService: usertest.NewUserServiceFake(),
|
userService: usertest.NewUserServiceFake(),
|
||||||
orgService: orgService,
|
orgService: orgService,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user