index

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provides = wire.NewSet(
	wire.Struct(new(Controller), "*"),
	wire.Struct(new(Service), "*"),
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	V    *common.Values
	Csrf *csrf.Csrf

	IndexX *Service
}

func (*Controller) ForgetReset added in v0.1.0

func (x *Controller) ForgetReset(ctx context.Context, c *app.RequestContext)

func (*Controller) GetForgetCode added in v0.1.0

func (x *Controller) GetForgetCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetLoginSms added in v0.1.0

func (x *Controller) GetLoginSms(ctx context.Context, c *app.RequestContext)

func (*Controller) GetRefreshCode

func (x *Controller) GetRefreshCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUser

func (x *Controller) GetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUserPhoneCode added in v0.1.0

func (x *Controller) GetUserPhoneCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUserTotp added in v0.1.0

func (x *Controller) GetUserTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) Login added in v0.0.29

func (x *Controller) Login(ctx context.Context, c *app.RequestContext)

func (*Controller) LoginSms added in v0.1.0

func (x *Controller) LoginSms(ctx context.Context, c *app.RequestContext)

func (*Controller) LoginTotp added in v0.1.0

func (x *Controller) LoginTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) Logout added in v0.0.29

func (x *Controller) Logout(ctx context.Context, c *app.RequestContext)

func (*Controller) Options added in v0.0.29

func (x *Controller) Options(_ context.Context, c *app.RequestContext)

func (*Controller) Ping added in v0.0.29

func (x *Controller) Ping(_ context.Context, c *app.RequestContext)

func (*Controller) RefreshToken added in v0.0.29

func (x *Controller) RefreshToken(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUser

func (x *Controller) SetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserPassword added in v0.1.0

func (x *Controller) SetUserPassword(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserPhone added in v0.1.0

func (x *Controller) SetUserPhone(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserTotp added in v0.1.0

func (x *Controller) SetUserTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) UnsetUser

func (x *Controller) UnsetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) Verify added in v0.0.29

func (x *Controller) Verify(ctx context.Context, c *app.RequestContext)

type ForgetResetDto added in v0.1.0

type ForgetResetDto struct {
	Email    string `json:"email" vd:"email"`
	Code     string `json:"code" vd:"required"`
	Password string `json:"password" vd:"required"`
}

type GetForgetCodeDto added in v0.1.0

type GetForgetCodeDto struct {
	Email string `query:"email" vd:"email"`
}

type GetLoginSmsDto added in v0.1.0

type GetLoginSmsDto struct {
	Phone string `query:"phone" vd:"required"`
}

type GetUserPhone added in v0.1.0

type GetUserPhone struct {
	Phone string `query:"phone" vd:"required"`
}

type LoginDto added in v0.0.29

type LoginDto struct {
	Email    string `json:"email" vd:"email"`
	Password string `json:"password" vd:"min=8"`
}

type LoginResult added in v0.1.0

type LoginResult struct {
	User        model.User
	AccessToken string
}

type LoginSmsDto added in v0.1.0

type LoginSmsDto struct {
	Phone string `json:"phone" vd:"required"`
	Code  string `json:"code" vd:"required"`
}

type LoginTotpDto added in v0.1.0

type LoginTotpDto struct {
	Email string `json:"email" vd:"email"`
	Code  string `json:"code" vd:"required"`
}

type M added in v0.1.0

type M = map[string]interface{}

func R added in v0.1.17

func R(code string, msg string) M

type OptionsDto added in v0.0.29

type OptionsDto struct {
	Type string `query:"type"`
}

type RefreshTokenDto added in v0.0.29

type RefreshTokenDto struct {
	Code string `json:"code" vd:"required"`
}

type Service

type Service struct {
	*common.Inject
	Sessions *sessions.Service
	Passport *common.APIPassport
	TencentX *tencent.Service
}

func (*Service) CreateAccessToken added in v0.1.0

func (x *Service) CreateAccessToken(ctx context.Context, userId string) (ts string, err error)

func (*Service) ForgetReset added in v0.1.0

func (x *Service) ForgetReset(ctx context.Context, dto ForgetResetDto) (err error)

func (*Service) GetForgetCode added in v0.1.0

func (x *Service) GetForgetCode(ctx context.Context, username string) (err error)

func (*Service) GetLoginSms added in v0.1.0

func (x *Service) GetLoginSms(ctx context.Context, phone string) (code string, err error)

func (*Service) GetRefreshCode

func (x *Service) GetRefreshCode(ctx context.Context, userId string) (code string, err error)

func (*Service) GetUser

func (x *Service) GetUser(ctx context.Context, userId string) (data M, err error)

func (*Service) GetUserPhoneCode added in v0.1.0

func (x *Service) GetUserPhoneCode(ctx context.Context, phone string) (code string, err error)

func (*Service) GetUserTotp added in v0.1.0

func (x *Service) GetUserTotp(ctx context.Context, userId string) (uri string, err error)

func (*Service) Login

func (x *Service) Login(ctx context.Context, username string, password string) (r *LoginResult, err error)

func (*Service) LoginSms added in v0.1.0

func (x *Service) LoginSms(ctx context.Context, phone string, code string) (r *LoginResult, err error)

func (*Service) LoginTotp added in v0.1.0

func (x *Service) LoginTotp(ctx context.Context, email string, code string) (r *LoginResult, err error)

func (*Service) Logining added in v0.1.0

func (x *Service) Logining(ctx context.Context, filter bson.M) (u model.User, err error)

func (*Service) Logout added in v0.0.29

func (x *Service) Logout(ctx context.Context, userId string)

func (*Service) RefreshToken added in v0.0.29

func (x *Service) RefreshToken(ctx context.Context, claims passport.Claims, code string) (ts string, err error)

func (*Service) SetUser

func (x *Service) SetUser(ctx context.Context, userId string, update bson.M) (result interface{}, err error)

func (*Service) SetUserPassword added in v0.1.0

func (x *Service) SetUserPassword(ctx context.Context, userId string, old string, password string) (r interface{}, err error)

func (*Service) SetUserPhone added in v0.1.0

func (x *Service) SetUserPhone(ctx context.Context, userId string, phone string, code string) (r interface{}, err error)

func (*Service) SetUserTotp added in v0.1.0

func (x *Service) SetUserTotp(ctx context.Context, userId string, uri string, tss [2]string) (r interface{}, err error)

func (*Service) Verify added in v0.0.29

func (x *Service) Verify(ctx context.Context, ts string) (claims passport.Claims, err error)

func (*Service) WriteLogsetLogin added in v0.1.16

func (x *Service) WriteLogsetLogin(ctx context.Context, data *model.LogsetLogin) (err error)

type SetUserDto added in v0.0.29

type SetUserDto struct {
	Key    string `json:"key" vd:"oneof='email' 'name' 'avatar'"`
	Email  string `json:"email" vd:"required_if=Key 'Email',omitempty,email"`
	Name   string `json:"name" vd:"required_if=Key 'Name'"`
	Avatar string `json:"avatar" vd:"required_if=Key 'Avatar'"`
}

type SetUserPassword added in v0.1.0

type SetUserPassword struct {
	Old      string `json:"old" vd:"min=8"`
	Password string `json:"password" vd:"min=8"`
}

type SetUserPhone added in v0.1.0

type SetUserPhone struct {
	Phone string `json:"phone" vd:"required"`
	Code  string `json:"code" vd:"required"`
}

type SetUserTotp added in v0.1.0

type SetUserTotp struct {
	Totp string    `json:"totp" vd:"required"`
	Tss  [2]string `json:"tss" vd:"len=2"`
}

type UnsetUserDto added in v0.0.29

type UnsetUserDto struct {
	Key string `path:"key" vd:"oneof='phone' 'totp' 'lark'"`
}

Jump to

Keyboard shortcuts

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