generated from VLADIMIR/template
fix names
This commit is contained in:
@@ -160,7 +160,7 @@ func main() {
|
|||||||
teamService := team_service.NewTeamService(gameRepo, teamRepo, passwordGenerator, os.Getenv("APP_BASE_URL"), emailSender)
|
teamService := team_service.NewTeamService(gameRepo, teamRepo, passwordGenerator, os.Getenv("APP_BASE_URL"), emailSender)
|
||||||
|
|
||||||
participationService := participation_service.NewParticipationService(teamRepo, os.Getenv("APP_BASE_URL"))
|
participationService := participation_service.NewParticipationService(teamRepo, os.Getenv("APP_BASE_URL"))
|
||||||
ticketService := ticket_service.New(ticketRepo, os.Getenv("APP_BASE_URL"))
|
ticketService := ticket_service.NewTicketService(ticketRepo, os.Getenv("APP_BASE_URL"))
|
||||||
go participationService.RunParticipationEmails(context.Background(), emailSender, os.Getenv("PARTICIPATION_SECRET"), os.Getenv("GAME_TIMEZONE"))
|
go participationService.RunParticipationEmails(context.Background(), emailSender, os.Getenv("PARTICIPATION_SECRET"), os.Getenv("GAME_TIMEZONE"))
|
||||||
go reviewService.RunReviewReminderEmails(context.Background(), emailSender)
|
go reviewService.RunReviewReminderEmails(context.Background(), emailSender)
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ type server struct {
|
|||||||
answerService *answer_service.AnswerService
|
answerService *answer_service.AnswerService
|
||||||
reviewService *game_review_service.GameReviewService
|
reviewService *game_review_service.GameReviewService
|
||||||
teamService *team_service.TeamService
|
teamService *team_service.TeamService
|
||||||
ticketService *ticket_service.Service
|
ticketService *ticket_service.TicketService
|
||||||
participationService *participation_service.ParticipationService
|
participationService *participation_service.ParticipationService
|
||||||
screenService *screen_service.ScreenService
|
screenService *screen_service.ScreenService
|
||||||
mapService *map_service.MapService
|
mapService *map_service.MapService
|
||||||
@@ -45,7 +45,7 @@ func NewServer(
|
|||||||
answerService *answer_service.AnswerService,
|
answerService *answer_service.AnswerService,
|
||||||
reviewService *game_review_service.GameReviewService,
|
reviewService *game_review_service.GameReviewService,
|
||||||
teamService *team_service.TeamService,
|
teamService *team_service.TeamService,
|
||||||
ticketService *ticket_service.Service,
|
ticketService *ticket_service.TicketService,
|
||||||
participationService *participation_service.ParticipationService,
|
participationService *participation_service.ParticipationService,
|
||||||
screenService *screen_service.ScreenService,
|
screenService *screen_service.ScreenService,
|
||||||
mapService *map_service.MapService,
|
mapService *map_service.MapService,
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ type Page struct {
|
|||||||
UsedBy *string
|
UsedBy *string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Service struct {
|
type TicketService struct {
|
||||||
repo *tickets_repo.Repo
|
repo *tickets_repo.Repo
|
||||||
appBaseURL string
|
appBaseURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(repo *tickets_repo.Repo, appBaseURL string) *Service {
|
func NewTicketService(repo *tickets_repo.Repo, appBaseURL string) *TicketService {
|
||||||
return &Service{repo: repo, appBaseURL: appBaseURL}
|
return &TicketService{repo: repo, appBaseURL: appBaseURL}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Issue(ctx context.Context, gameID, count int) ([]*Ticket, error) {
|
func (s *TicketService) Issue(ctx context.Context, gameID, count int) ([]*Ticket, error) {
|
||||||
if count < 1 || count > maxTicketsPerRequest {
|
if count < 1 || count > maxTicketsPerRequest {
|
||||||
return nil, ErrInvalidTicketCount
|
return nil, ErrInvalidTicketCount
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ func (s *Service) Issue(ctx context.Context, gameID, count int) ([]*Ticket, erro
|
|||||||
return tickets, nil
|
return tickets, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Get(ctx context.Context, token string) (*Page, error) {
|
func (s *TicketService) Get(ctx context.Context, token string) (*Page, error) {
|
||||||
hash, err := tokenHash(token)
|
hash, err := tokenHash(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrTicketNotFound
|
return nil, ErrTicketNotFound
|
||||||
@@ -107,7 +107,7 @@ func (s *Service) Get(ctx context.Context, token string) (*Page, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Accept(ctx context.Context, token string, userID int) (*Page, error) {
|
func (s *TicketService) Accept(ctx context.Context, token string, userID int) (*Page, error) {
|
||||||
hash, err := tokenHash(token)
|
hash, err := tokenHash(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ErrTicketNotFound
|
return nil, ErrTicketNotFound
|
||||||
|
|||||||
Reference in New Issue
Block a user