service

package
v0.0.0-...-2f866d2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package service 代表领域服务

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateEmail        = repository.ErrDuplicateUser
	ErrInvalidUserOrPassword = errors.New("用户不存在或者密码不对")
)
View Source
var ErrCodeSendTooMany = repository.ErrCodeSendTooMany

Functions

This section is empty.

Types

type CodeService

type CodeService interface {
	Send(ctx context.Context, biz, phone string) error
	Verify(ctx context.Context,
		biz, phone, inputCode string) (bool, error)
}

func NewCodeService

func NewCodeService(repo repository.CodeRepository, smsSvc sms.Service) CodeService

type UserService

type UserService interface {
	Signup(ctx context.Context, u domain.User) error
	Login(ctx context.Context, email string, password string) (domain.User, error)
	UpdateNonSensitiveInfo(ctx context.Context,
		user domain.User) error
	FindById(ctx context.Context,
		uid int64) (domain.User, error)
	FindOrCreate(ctx context.Context, phone string) (domain.User, error)
}

func NewUserService

func NewUserService(repo repository.UserRepository) UserService

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.
sms
mocks
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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