services

package
v0.0.0-...-474b416 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2024 License: 0BSD Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module exports services present

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

AuthService service relating to authorization

func (*AuthService) Authorize

func (s *AuthService) Authorize(tokenString string) (*models.JWTClaim, error)

Authorize authorizes the generated token

func (*AuthService) GenerateJWTTokens

func (s *AuthService) GenerateJWTTokens(user models.User) (string, string, int64, int64, error)

GenerateJWTTokens creates jwt auth tokens

func (*AuthService) Refresh

func (s *AuthService) Refresh(user models.User) (string, int64, error)

func (*AuthService) Register

func (s *AuthService) Register(request models.RegisterRequest) (*models.User, error)

type IAuthService

type IAuthService interface {
	Authorize(string) (*models.JWTClaim, error)
	GenerateJWTTokens(user models.User) (string, string, int64, int64, error)
	Register(request models.RegisterRequest) (*models.User, error)
	Refresh(user models.User) (string, int64, error)
}

func NewAuthService

func NewAuthService(
	env *core.Env,
	logger *core.Logger,
	userRepo repositories.IUserRepository,
) IAuthService

NewAuthService creates a new auth service

type IProfileService

type IProfileService interface {
	CreateProfile(string, models.ProfileCreateRequest) error
	GetProfileById(string) (*models.Profile, error)
	UpdateProfileById(string, models.ProfileUpdateRequest) error
	UpdateProfileImageById(string, []int) error
	DeleteProfileById(string) error
}

func NewProfileService

func NewProfileService(repository repositories.IProfileRepository, logger *core.Logger) IProfileService

type IRecommendService

type IRecommendService interface {
	CreateUserAnswer(models.SerializableAnswer) error
	GetMatchesByUserId(string) error
	GetAnswersByUserId(string) ([]models.SerializableAnswer, error)
	GetListQuestions() ([]models.SerializableQuestion, error)
	GetRecommendationByUserId(string, int, int, float64, float64) ([]models.MatchProfile, error)
	SmashById(string, string) (string, *models.Profile, error)
	PassById(string, string) error
}

func NewRecommendService

func NewRecommendService(
	profileRepository repositories.IProfileRepository,
	answerRepository repositories.IAnswerRepository,
	matchRepository repositories.IMatchRepository,
	questionRepository repositories.IQuestionRepository,
	recommendationBinRepository repositories.IRecommendationBinRepository,
	logger *core.Logger,
) IRecommendService

type IUserService

type IUserService interface {
	First(models.OneUserFilter) (*models.User, error)
	UpdateById(string, models.UserUpdateRequest) error
}

IUserService interface

func NewUserService

func NewUserService(logger *core.Logger, repository repositories.IUserRepository) IUserService

NewUserService creates a new user service

type ProfileService

type ProfileService struct {
	// contains filtered or unexported fields
}

func (*ProfileService) CreateProfile

func (s *ProfileService) CreateProfile(userID string, request models.ProfileCreateRequest) error

func (*ProfileService) DeleteProfileById

func (s *ProfileService) DeleteProfileById(id string) error

func (*ProfileService) GetProfileById

func (s *ProfileService) GetProfileById(id string) (*models.Profile, error)

func (*ProfileService) UpdateProfileById

func (s *ProfileService) UpdateProfileById(id string, request models.ProfileUpdateRequest) error

func (*ProfileService) UpdateProfileImageById

func (s *ProfileService) UpdateProfileImageById(id string, slots []int) error

type RecommendService

type RecommendService struct {
	// contains filtered or unexported fields
}

func (*RecommendService) CreateUserAnswer

func (s *RecommendService) CreateUserAnswer(answer models.SerializableAnswer) error

func (*RecommendService) GetAnswersByUserId

func (s *RecommendService) GetAnswersByUserId(id string) ([]models.SerializableAnswer, error)

func (*RecommendService) GetListQuestions

func (s *RecommendService) GetListQuestions() ([]models.SerializableQuestion, error)

func (*RecommendService) GetMatchesByUserId

func (s *RecommendService) GetMatchesByUserId(id string) error

func (*RecommendService) GetRecommendationByUserId

func (s *RecommendService) GetRecommendationByUserId(
	userId string,
	minAge int,
	maxAge int,
	minDistance float64,
	maxDistance float64,
) ([]models.MatchProfile, error)

func (*RecommendService) PassById

func (s *RecommendService) PassById(passerId string, passeeId string) error

func (*RecommendService) SmashById

func (s *RecommendService) SmashById(matcherId string, matcheeId string) (string, *models.Profile, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService service layer

func (*UserService) First

func (u *UserService) First(filter models.OneUserFilter) (user *models.User, err error)

func (*UserService) UpdateById

func (u *UserService) UpdateById(id string, request models.UserUpdateRequest) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL