This commit is contained in:
2026-03-02 01:43:46 +07:00
parent 5604732fcb
commit 3b9c77b422
5 changed files with 55 additions and 50 deletions
+5 -8
View File
@@ -22,17 +22,20 @@ type Services struct {
repository *Repository
storyService *story_service.StoryService
linkService link.ILinkService
clientHost string
}
func NewServices(
repository *Repository,
storyService *story_service.StoryService,
linkService link.ILinkService,
clientHost string,
) *Services {
return &Services{
repository: repository,
storyService: storyService,
linkService: linkService,
clientHost: clientHost,
}
}
@@ -157,10 +160,7 @@ func (s *Services) GetTeams(ctx context.Context, _ *proto.GetTeamsReq) (*proto.G
if err != nil {
return nil, err
}
newTeam.Url, err = s.linkService.GetTeamClientLink(team.Name, team.Password)
if err != nil {
return nil, err
}
newTeam.Url = s.linkService.GetTeamClientLink(s.clientHost, team.Name, team.Password)
newTeam.SpendTime = int64(len(actions))
currentApplications, err := s.repository.GetApplicationsByState(ctx, team.ID, "NEW")
if err != nil {
@@ -198,10 +198,7 @@ func (s *Services) DownloadTeamsQrCodesFile(ctx context.Context, req *proto.Down
return nil, err
}
for _, team := range teams {
team.Link, err = s.linkService.GetTeamClientLink(team.Name, team.Password)
if err != nil {
return nil, err
}
team.Link = s.linkService.GetTeamClientLink(s.clientHost, team.Name, team.Password)
}
b, err := pdf_service.CreateTeamsPdf(teams)
if err != nil {