service

package
Version: v0.0.0-...-de569a9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 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 (u *UserServiceImpl) Login(ctx context.Context, email, password string) (*UserInfoDTO, error)

登录

func (*UserServiceImpl) Register

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

注册

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL