24 lines
477 B
Go
24 lines
477 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.entityseven.com/rilaxik/pllist/internal/domain"
|
|
)
|
|
|
|
type UserRepository interface {
|
|
Ensure(ctx context.Context, telegramID int64) (domain.User, error)
|
|
}
|
|
|
|
type UserService struct {
|
|
users UserRepository
|
|
}
|
|
|
|
func NewUserService(users UserRepository) *UserService {
|
|
return &UserService{users: users}
|
|
}
|
|
|
|
func (s *UserService) Ensure(ctx context.Context, telegramID int64) (domain.User, error) {
|
|
return s.users.Ensure(ctx, telegramID)
|
|
}
|