Documentation
¶
Index ¶
- func NewService(cfg *common.Config) *iris.Application
- func RegisterRoute(app *iris.Application, cors context.Handler, cfg *common.Config)
- type AccountModel
- type ActivateModel
- type AuthRepository
- type AuthRoute
- func (r *AuthRoute) BeforeActivation(b mvc.BeforeActivation)
- func (r *AuthRoute) GetActivate()
- func (r *AuthRoute) GetRefreshToken(rft string)
- func (r *AuthRoute) GetUpdateContact()
- func (r *AuthRoute) PostChangePassword()
- func (r *AuthRoute) PostCreateNewPassword()
- func (r *AuthRoute) PostSignIn()
- func (r *AuthRoute) PostSocialSignIn()
- type AuthService
- type ChangePasswordModel
- type EmailProfileModel
- type ForgotPassword
- type MobileProfileModel
- type OtpModel
- type Profile
- type ProfileModel
- type RefreshToken
- type RegisterModel
- type SignInModel
- type SignInResponse
- type SocialNetwork
- type SocialNetworkModel
- type UpdateContact
- type UserModel
- type UserProfile
- type VerifyContact
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(cfg *common.Config) *iris.Application
func RegisterRoute ¶
Types ¶
type AccountModel ¶
type AccountModel struct {
ID uint64 `json:"ID" bson:"_id,omitempty" `
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
SocialNetwork []SocialNetwork `json:"SocialNetwork" bson:"social_network"`
ActivatedDate int64 `json:"activated_date" bson:"activated_date"`
Profile Profile `json:"profile" bson:"profile"`
Status int `json:"status" bson:"status"`
}
type ActivateModel ¶
type AuthRepository ¶
type AuthRepository interface {
SignIn(*SignInModel) (*UserModel, *ProfileModel, error)
VerifyBySms(mobile string, otpCode string) (*RegisterModel, error)
VerifyByEmail(email string, activateCode string) (*RegisterModel, error)
CreateID(registerInfo *RegisterModel, smartID uint64) (*UserProfile, error)
ReadMailPool(email string) (*EmailProfileModel, error)
ReadMobilePool(mobile string, code string) (*MobileProfileModel, error)
UpdateProfileContactWithCombineUser(username string, smartID uint64, contactType int) (bool, error)
UpdateProfileContact(contact string, smartID uint64, contactType int) (bool, error)
ReadPassword(string) (*UserModel, error)
WritePassword(string, string) (bool, error)
CreateRefreshToken(string, interface{}, time.Duration) (bool, error)
ReadRefreshToken(string) (string, error)
ReadOTP(code string) (string, error)
}
func NewAuthRepository ¶
type AuthRoute ¶
type AuthRoute struct {
common.Context
Service AuthService
}
func (*AuthRoute) BeforeActivation ¶
func (r *AuthRoute) BeforeActivation(b mvc.BeforeActivation)
func (*AuthRoute) GetActivate ¶
func (r *AuthRoute) GetActivate()
func (*AuthRoute) GetRefreshToken ¶
func (*AuthRoute) GetUpdateContact ¶
func (r *AuthRoute) GetUpdateContact()
func (*AuthRoute) PostChangePassword ¶
func (r *AuthRoute) PostChangePassword()
func (*AuthRoute) PostCreateNewPassword ¶
func (r *AuthRoute) PostCreateNewPassword()
func (*AuthRoute) PostSignIn ¶
func (r *AuthRoute) PostSignIn()
func (*AuthRoute) PostSocialSignIn ¶
func (r *AuthRoute) PostSocialSignIn()
type AuthService ¶
type AuthService interface {
SignIn(*SignInModel) (interface{}, error)
Verify(activate *ActivateModel) (interface{}, error)
UpdateContact(*UpdateContact) (interface{}, error)
ChangePassword(*ChangePasswordModel) (bool, error)
ConfirmVerify(*VerifyContact) (bool, error)
SignInViaRefreshToken(string) (interface{}, error)
ForgotPassword(string, string, string) (bool, error)
}
AuthService interface
func NewAuthService ¶
func NewAuthService(repo AuthRepository, conf *common.Config) AuthService
NewAuthService method
type ChangePasswordModel ¶
type EmailProfileModel ¶
type EmailProfileModel struct {
ID string `json:"id" bson:"_id,omitempty"`
SID uint64 `json:"sid" bson:"sid"`
Code string `json:"code" bson:"code"`
FullName string `json:"full_name" bson:"full_name"`
Username string `json:"username" bson:"username"`
Email string `json:"email" bson:"email"`
Used bool `json:"used" bson:"used"`
}
type ForgotPassword ¶
type MobileProfileModel ¶
type MobileProfileModel struct {
ID string `json:"id" bson:"_id,omitempty"`
SID uint64 `json:"sid" bson:"sid"`
Code string `json:"code" bson:"code"`
FullName string `json:"full_name" bson:"full_name"`
Username string `json:"username" bson:"username"`
Mobile string `json:"mobile" bson:"mobile"`
Used bool `json:"used" bson:"used"`
}
type Profile ¶
type Profile struct {
ID uint64
FirstName string `json:"first_name" bson:"first_name"`
LastName string `json:"last_name" bson:"last_name"`
FullName string `json:"full_name" bson:"full_name"`
Gender int `json:"gender" bson:"gender"`
BirthDate int64 `json:"birth_date" bson:"birth_date"`
Address string `json:"address" bson:"address"`
Avatar string `json:"avatar" bson:"avatar"`
Mobile string `json:"mobile" bson:"mobile"`
Email string `json:"email" bson:"email"`
Cover string `json:"cover" bson:"cover"`
CreatedDate int64 `json:"created_date" bson:"created_date"`
LastUpdate int64 `json:"last_update" bson:"last_update"`
}
type ProfileModel ¶
type ProfileModel struct {
ID uint64 `json:"id" bson:"_id,omitempty" `
FirstName string `json:"first_name" bson:"first_name"`
LastName string `json:"last_name" bson:"last_name"`
FullName string `json:"full_name" bson:"full_name"`
Gender int `json:"gender" bson:"gender"`
BirthDate int64 `json:"birth_date" bson:"birth_date"`
Address string `json:"address" bson:"address"`
Avatar string `json:"avatar" bson:"avatar"`
Mobile string `json:"mobile" bson:"mobile"`
Email string `json:"email" bson:"email"`
Cover string `json:"cover" bson:"cover"`
CreatedDate int64 `json:"created_date" bson:"created_date"`
LastUpdate int64 `json:"last_update" bson:"last_update"`
}
type RefreshToken ¶
type RefreshToken struct {
UserName string `json:"username"`
Profile *ProfileModel `json:"profile"`
}
type RegisterModel ¶
type RegisterModel struct {
ID string `json:"ID" bson:"_id,omitempty" `
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
SocialNetwork []SocialNetwork `json:"SocialNetwork" bson:"social_network"`
Profile Profile `json:"profile" bson:"profile"`
RegisteredDate int64 `json:"registered_date" bson:"registered_date"`
VerifyCode string `json:"verify_code" bson:"verify_code"`
VerifiedDate int `json:"verified_date" bson:"verified_date"`
}
type SignInModel ¶
type SignInResponse ¶
type SocialNetwork ¶
type SocialNetworkModel ¶
type UpdateContact ¶
type UserModel ¶
type UserModel struct {
ID string `json:"id" bson:"_id,omitempty" `
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
ProfileID uint64 `json:"profile_id" bson:"profile_id"`
ActivatedDate int64 `json:"activated_date" bson:"activated_date"`
Status int `json:"status" bson:"status"`
}
type UserProfile ¶
type UserProfile struct {
SmartID uint64 `json:"smart_id"`
Username string `json:"username"`
Profile *ProfileModel `json:"profile"`
ActivatedDate int64 `json:"activated_date"`
Status int `json:"status"`
}
type VerifyContact ¶
Click to show internal directories.
Click to hide internal directories.