Documentation ¶
Index ¶
- func NewService(cfg *common.Config) *iris.Application
- func RegisterRoute(app *iris.Application, cors context.Handler, cfg *common.Config)
- type AccountRepository
- type AccountRoute
- func (r *AccountRoute) BeforeActivation(b mvc.BeforeActivation)
- func (r *AccountRoute) GetProfile(sid uint64)
- func (r *AccountRoute) PostRegister()
- func (r *AccountRoute) PostUpdateAvatar(sid uint64)
- func (r *AccountRoute) PostUpdateCover(sid uint64)
- func (r *AccountRoute) PostUpdateEmail(sid string)
- func (r *AccountRoute) PostUpdateMobile(sid string)
- func (r *AccountRoute) PostUpdateProfile(sid uint64)
- type AccountService
- type AuthUpdate
- type EmailProfileModel
- type MobileProfileModel
- type Profile
- type RegisterModel
- type TokenClaims
- 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 AccountRepository ¶
type AccountRepository interface { Register(*RegisterModel) (interface{}, error) GetProfileById(sid uint64) (*Profile, error) GetUserById(username string) (*UserModel, error) CreateEmailPool(*EmailProfileModel) (bool, error) CreateMobilePool(*MobileProfileModel) (bool, error) UpdateProfile(*Profile) (bool, error) UpdateAvatar(*Profile) (bool, error) UpdateCover(*Profile) (bool, error) }
func NewAccountReportsitory ¶
func NewAccountReportsitory(db *mgo.Session, cfg *common.Config) AccountRepository
type AccountRoute ¶
type AccountRoute struct { common.Context Service AccountService }
func (*AccountRoute) BeforeActivation ¶
func (r *AccountRoute) BeforeActivation(b mvc.BeforeActivation)
func (*AccountRoute) GetProfile ¶
func (r *AccountRoute) GetProfile(sid uint64)
func (*AccountRoute) PostRegister ¶
func (r *AccountRoute) PostRegister()
func (*AccountRoute) PostUpdateAvatar ¶
func (r *AccountRoute) PostUpdateAvatar(sid uint64)
func (*AccountRoute) PostUpdateCover ¶
func (r *AccountRoute) PostUpdateCover(sid uint64)
func (*AccountRoute) PostUpdateEmail ¶
func (r *AccountRoute) PostUpdateEmail(sid string)
func (*AccountRoute) PostUpdateMobile ¶
func (r *AccountRoute) PostUpdateMobile(sid string)
func (*AccountRoute) PostUpdateProfile ¶
func (r *AccountRoute) PostUpdateProfile(sid uint64)
type AccountService ¶
type AccountService interface { Register(*RegisterModel) (interface{}, error) Update(profile string) (interface{}, error) Profile(id uint64, token string) (interface{}, error) UpdateEmail(prof *AuthUpdate) (bool, error) UpdateMobile(prof *AuthUpdate) (bool, error) UpdateProfile(prof *Profile, sid uint64) (bool, error) UpdateAvatar(prof *Profile, sid uint64) (bool, error) UpdateCover(prof *Profile, sid uint64) (bool, error) }
AccountService ...interface ...
func NewAccountService ¶
func NewAccountService(repo AccountRepository, conf *common.Config) AccountService
NewAccountService ...
type AuthUpdate ¶
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 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:"email" bson:"email"` Used bool `json:"used" bson:"used"` }
type Profile ¶
type Profile 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 TokenClaims ¶
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.