generated from VLADIMIR/template
fix names
This commit is contained in:
@@ -40,16 +40,16 @@ type Page struct {
|
||||
UsedBy *string
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
type TicketService struct {
|
||||
repo *tickets_repo.Repo
|
||||
appBaseURL string
|
||||
}
|
||||
|
||||
func New(repo *tickets_repo.Repo, appBaseURL string) *Service {
|
||||
return &Service{repo: repo, appBaseURL: appBaseURL}
|
||||
func NewTicketService(repo *tickets_repo.Repo, appBaseURL string) *TicketService {
|
||||
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 {
|
||||
return nil, ErrInvalidTicketCount
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func (s *Service) Issue(ctx context.Context, gameID, count int) ([]*Ticket, erro
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, ErrTicketNotFound
|
||||
@@ -107,7 +107,7 @@ func (s *Service) Get(ctx context.Context, token string) (*Page, error) {
|
||||
}, 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)
|
||||
if err != nil {
|
||||
return nil, ErrTicketNotFound
|
||||
|
||||
Reference in New Issue
Block a user