Documentation ¶
Index ¶
- Variables
- type AuthRepo
- type AuthUsecase
- func (ac *AuthUsecase) GetAuthInfo(ctx context.Context) (*v1.GetAuthInfoResponse, error)
- func (ac *AuthUsecase) LoginByPassword(ctx context.Context, pb *v1.LoginByPasswordRequest) (*v1.LoginResponse, error)
- func (ac *AuthUsecase) Logout(ctx context.Context) error
- func (ac *AuthUsecase) Register(ctx context.Context, pb *v1.RegisterRequest) error
- type LoginResult
- type Role
- type RoleRepo
- type RoleUsecase
- type Transaction
- type User
- type UserRepo
- type UserUsecase
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRoleNotFound is user not found. ErrRoleNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found") )
View Source
var ( // ErrUserNotFound is user not found. ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found") )
View Source
var ProviderSet = wire.NewSet(NewAuthUsecase, NewUserUsecase, NewRoleUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type AuthRepo ¶
type AuthRepo interface { // 用户认证 Register(context.Context, *v1.RegisterRequest) error Logout(context.Context) error LoginByPassword(context.Context, *v1.LoginByPasswordRequest) (*v1.LoginResponse, error) // 访问用户相关 GetAuthInfo(context.Context) (*v1.GetAuthInfoResponse, error) }
AuthRepo is a Greater repo.
type AuthUsecase ¶
type AuthUsecase struct {
// contains filtered or unexported fields
}
AuthUsecase is a User usecase.
func NewAuthUsecase ¶
func NewAuthUsecase(repo AuthRepo, logger log.Logger) *AuthUsecase
NewAuthUsecase new a User usecase.
func (*AuthUsecase) GetAuthInfo ¶
func (ac *AuthUsecase) GetAuthInfo(ctx context.Context) (*v1.GetAuthInfoResponse, error)
GetInfo 用户信息
func (*AuthUsecase) LoginByPassword ¶
func (ac *AuthUsecase) LoginByPassword(ctx context.Context, pb *v1.LoginByPasswordRequest) (*v1.LoginResponse, error)
Login 登录-密码登录
func (*AuthUsecase) Register ¶
func (ac *AuthUsecase) Register(ctx context.Context, pb *v1.RegisterRequest) error
Login 登录-密码登录
type LoginResult ¶
type RoleRepo ¶
type RoleRepo interface { Save(context.Context, *Role) (*Role, error) Update(context.Context, *Role) (*Role, error) FindByID(context.Context, int64) (*Role, error) ListByName(context.Context, string) ([]*Role, error) ListAll(context.Context) ([]*Role, error) }
RoleRepo is a Greater repo.
type RoleUsecase ¶
type RoleUsecase struct {
// contains filtered or unexported fields
}
RoleUsecase is a Role usecase.
func NewRoleUsecase ¶
func NewRoleUsecase(repo RoleRepo, logger log.Logger) *RoleUsecase
NewRoleUsecase new a Role usecase.
func (*RoleUsecase) CreateRole ¶
CreateRole creates a Role, and returns the new Role.
type Transaction ¶
type UserRepo ¶
type UserRepo interface { Save(context.Context, *User) (*User, error) Update(context.Context, *User) (*User, error) FindByID(context.Context, int64) (*User, error) ListByName(context.Context, string) ([]*User, error) ListAll(context.Context) ([]*User, error) }
UserRepo is a Greater repo.
type UserUsecase ¶
type UserUsecase struct {
// contains filtered or unexported fields
}
UserUsecase is a User usecase.
func NewUserUsecase ¶
func NewUserUsecase(repo UserRepo, logger log.Logger) *UserUsecase
NewUserUsecase new a User usecase.
func (*UserUsecase) CreateUser ¶
CreateUser creates a User, and returns the new User.
Click to show internal directories.
Click to hide internal directories.