generated from VLADIMIR/template
clear
This commit is contained in:
@@ -19,23 +19,26 @@ import (
|
||||
)
|
||||
|
||||
type Services struct {
|
||||
repository *Repository
|
||||
storyService *story_service.StoryService
|
||||
linkService link.ILinkService
|
||||
clientHost string
|
||||
repository *Repository
|
||||
storyService *story_service.StoryService
|
||||
linkService link.ILinkService
|
||||
passwordGenerator password.IPasswordGenerator
|
||||
clientHost string
|
||||
}
|
||||
|
||||
func NewServices(
|
||||
repository *Repository,
|
||||
storyService *story_service.StoryService,
|
||||
linkService link.ILinkService,
|
||||
passwordGenerator password.IPasswordGenerator,
|
||||
clientHost string,
|
||||
) *Services {
|
||||
return &Services{
|
||||
repository: repository,
|
||||
storyService: storyService,
|
||||
linkService: linkService,
|
||||
clientHost: clientHost,
|
||||
repository: repository,
|
||||
storyService: storyService,
|
||||
linkService: linkService,
|
||||
passwordGenerator: passwordGenerator,
|
||||
clientHost: clientHost,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +179,7 @@ func (s *Services) AddTeams(ctx context.Context, req *proto.AddTeamsReq) (*proto
|
||||
inTeams := make([]*models.Team, 0, len(req.Teams))
|
||||
for _, team := range req.Teams {
|
||||
t := mapProtoTeamsToTeam(team)
|
||||
t.Password = password.GenPass(8)
|
||||
t.Password = s.passwordGenerator.GeneratePassword(8)
|
||||
inTeams = append(inTeams, t)
|
||||
}
|
||||
teams, err := s.repository.AddTeams(ctx, inTeams)
|
||||
|
||||
Reference in New Issue
Block a user