Documentation ¶
Index ¶
- func NewService(cfg *common.Config) *iris.Application
- func RegisterRoute(app *iris.Application, cors context.Handler, cfg *common.Config)
- type EmailProfileModel
- type IrisSentResponse
- type IrisSignInResponse
- type MailModel
- type Message
- type MobileProfileModel
- type NotificatorRepository
- type NotificatorRoute
- type NotificatorService
- type OtpModel
- type Profile
- type ProfileModel
- type RegisterModel
- type SenderModel
- type SmsModel
- type UserModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(cfg *common.Config) *iris.Application
func RegisterRoute ¶
Types ¶
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 IrisSentResponse ¶
type IrisSignInResponse ¶
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 NotificatorRepository ¶
type NotificatorRepository interface { SaveOTP(key string, value interface{}, ttl time.Duration) (bool, error) RemoveOTP(*OtpModel) (bool, error) ReadOTP(key string) (string, error) ReadMailActivatedCode(email string) (*RegisterModel, error) ReadRegisterByUser(username string) (register *RegisterModel, err error) ReadIrisToken(brandName string) string WriteIrisToken(brandName string, token string, ttl time.Duration) (bool, error) ReadMailPool(email string) (*EmailProfileModel, error) ReadMobilePool(mobile string) (*MobileProfileModel, error) ReadUserProfile(string) (*UserModel, *ProfileModel, error) ReadUserAccount(string) (*UserModel, error) }
NotificatorRepository method
func NewNotificatorRepository ¶
func NewNotificatorRepository(sess *mgo.Session, redis *db.Redis, cfg *common.Config) NotificatorRepository
NewNotificatorRepository method
type NotificatorRoute ¶
type NotificatorRoute struct { common.Context Service NotificatorService }
func (*NotificatorRoute) BeforeActivation ¶
func (r *NotificatorRoute) BeforeActivation(b mvc.BeforeActivation)
func (*NotificatorRoute) PostSendMail ¶
func (r *NotificatorRoute) PostSendMail()
func (*NotificatorRoute) PostSendSms ¶
func (r *NotificatorRoute) PostSendSms()
func (*NotificatorRoute) PostSmsForgotPassword ¶
func (r *NotificatorRoute) PostSmsForgotPassword()
type NotificatorService ¶
type NotificatorService interface { SendEmail(*MailModel) (bool, error) SendSMS(*SmsModel) (interface{}, error) SendFirebase(channel string, title string, content string) (interface{}, error) }
func NewNotificatorService ¶
func NewNotificatorService(repo NotificatorRepository, conf *common.Config) NotificatorService
type OtpModel ¶
type OtpModel struct { ID string `json:"id"` Mobile string `json:"mobile"` TTL time.Duration `json:"ttl"` }
OtpModel model
type Profile ¶
type Profile struct { 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"` }
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"` }
type RegisterModel ¶
type RegisterModel struct { ID string `json:"ID" bson:"_id,omitempty" ` Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` 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 SenderModel ¶
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"` }
Click to show internal directories.
Click to hide internal directories.