Documentation ¶
Index ¶
- Variables
- type AuthService
- func (s *AuthService) Authorize(tokenString string) (*models.JWTClaim, error)
- func (s *AuthService) GenerateJWTTokens(user models.User) (string, string, int64, int64, error)
- func (s *AuthService) Refresh(user models.User) (string, int64, error)
- func (s *AuthService) Register(request models.RegisterRequest) (*models.User, error)
- type IAuthService
- type IProfileService
- type IRecommendService
- type IUserService
- type ProfileService
- func (s *ProfileService) CreateProfile(userID string, request models.ProfileCreateRequest) error
- func (s *ProfileService) DeleteProfileById(id string) error
- func (s *ProfileService) GetProfileById(id string) (*models.Profile, error)
- func (s *ProfileService) UpdateProfileById(id string, request models.ProfileUpdateRequest) error
- func (s *ProfileService) UpdateProfileImageById(id string, slots []int) error
- type RecommendService
- func (s *RecommendService) CreateUserAnswer(answer models.SerializableAnswer) error
- func (s *RecommendService) GetAnswersByUserId(id string) ([]models.SerializableAnswer, error)
- func (s *RecommendService) GetListQuestions() ([]models.SerializableQuestion, error)
- func (s *RecommendService) GetMatchesByUserId(id string) error
- func (s *RecommendService) GetRecommendationByUserId(userId string, minAge int, maxAge int, minDistance float64, ...) ([]models.MatchProfile, error)
- func (s *RecommendService) PassById(passerId string, passeeId string) error
- func (s *RecommendService) SmashById(matcherId string, matcheeId string) (string, *models.Profile, error)
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewUserService), fx.Provide(NewAuthService), fx.Provide(NewProfileService), fx.Provide(NewRecommendService), )
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 ¶
GenerateJWTTokens creates jwt auth tokens
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)
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
Click to show internal directories.
Click to hide internal directories.