Documentation ¶
Index ¶
- Variables
- type CodeService
- type DefaultUserService
- func (svc *DefaultUserService) EditProfile(ctx context.Context, p domain.Profile) error
- func (svc *DefaultUserService) FindOrCreate(ctx context.Context, phone string) (domain.User, error)
- func (svc *DefaultUserService) GetProfileByEmail(ctx context.Context, email string) (domain.Profile, error)
- func (svc *DefaultUserService) Login(ctx context.Context, email, password string) (domain.User, error)
- func (svc *DefaultUserService) SignUp(ctx context.Context, u domain.User) error
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeVerifyTooManyTimes = repository.ErrCodeVerifyTooManyTimes ErrCodeSendTooMany = repository.ErrCodeSendTooMany )
View Source
var ErrInvalidUserOrPassword = errors.New("账号/邮箱或密码不对")
View Source
var ErrUserDuplicateEmail = repository.ErrUserDuplicateEmail
Functions ¶
This section is empty.
Types ¶
type CodeService ¶
type CodeService interface { Send(ctx context.Context, biz string, phone string) error Verify(ctx context.Context, biz string, phone string, inputCode string) (bool, error) }
func NewCodeService ¶
func NewCodeService(repo repository.CodeRepository, smsSvc sms.Service) CodeService
type DefaultUserService ¶
type DefaultUserService struct {
// contains filtered or unexported fields
}
func (*DefaultUserService) EditProfile ¶
func (*DefaultUserService) FindOrCreate ¶
func (*DefaultUserService) GetProfileByEmail ¶
type UserService ¶
type UserService interface { Login(ctx context.Context, email, password string) (domain.User, error) SignUp(ctx context.Context, u domain.User) error FindOrCreate(ctx context.Context, phone string) (domain.User, error) //Profile(ctx context.Context, // id int64) (domain.User, error) EditProfile(ctx context.Context, p domain.Profile) error GetProfileByEmail(ctx context.Context, email string) (domain.Profile, error) }
func NewUserService ¶
func NewUserService(repo repository.UserRepository) UserService
Click to show internal directories.
Click to hide internal directories.