service

package
v0.0.0-...-99cece9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserExisted = errors.New("user is existed")
	ErrPassword    = errors.New("email and password are not match")
	ErrRegistering = errors.New("email is registering")
)

Functions

This section is empty.

Types

type RegisterUserVO

type RegisterUserVO struct {
	Username string
	Password string
	Email    string
}

type UserInfoDTO

type UserInfoDTO struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

type UserService

type UserService interface {
	// 登录接口
	Login(ctx context.Context, email, password string) (*UserInfoDTO, error)
	// 注册接口
	Register(ctx context.Context, vo *RegisterUserVO) (*UserInfoDTO, error)
}

func MakeUserServiceImpl

func MakeUserServiceImpl(userDAO dao.UserDAO) UserService

type UserServiceImpl

type UserServiceImpl struct {
	// contains filtered or unexported fields
}

func (*UserServiceImpl) Login

func (userService *UserServiceImpl) Login(ctx context.Context, email, password string) (*UserInfoDTO, error)

func (UserServiceImpl) Register

func (userService UserServiceImpl) Register(ctx context.Context, vo *RegisterUserVO) (*UserInfoDTO, error)

Jump to

Keyboard shortcuts

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