biz

package
v0.0.0-...-a2c21a8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	Sex        string    `json:"sex,omitempty"`
	Name       string    `json:"name,omitempty"`
	Avatar     string    `json:"avatar,omitempty"`
	Account    string    `json:"account,omitempty"`
	NickName   string    `json:"nick_name,omitempty"`
	Email      string    `json:"email,omitempty"`
	Mobile     string    `json:"mobile,omitempty"`
	IDCard     string    `json:"id_card,omitempty"`
	ID         int64     `json:"id,omitempty"`
	Password   string    `json:"-"`
	Salt       string    `json:"-"`
	LastIP     string    `json:"last_ip,omitempty"`
	Birthday   time.Time `json:"birthday,omitempty"`
	LastTime   time.Time `json:"last_time,omitempty"`
	CreateTime time.Time `json:"create_time,omitempty"`
	UpdateTime time.Time `json:"update_time,omitempty"`
	UUID       uuid.UUID `json:"uuid,omitempty"`
}

func (*Customer) CheckPassword

func (uc *Customer) CheckPassword(password string) bool

检查密码

func (*Customer) GenPassword

func (uc *Customer) GenPassword(password string) string

创建密码

func (*Customer) SetPassword

func (uc *Customer) SetPassword(password string)

创建密码

type CustomerRepo

type CustomerRepo interface {
	ListCustomer(ctx context.Context, op *pb.CustomerListOption) ([]*Customer, error)
	GetCustomer(ctx context.Context, id int64) (*Customer, error)
	CreateCustomer(ctx context.Context, article *Customer) (*Customer, error)
	UpdateCustomer(ctx context.Context, id int64, article *Customer) (*Customer, error)
	DeleteCustomer(ctx context.Context, id []int64) error
	GetCustomerForAccounts(ctx context.Context, account string) ([]*Customer, error)
	// 创建jwttoken
	CreateToken(member *Customer, time int64) (string, error)
}

type CustomerUsecase

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

func NewCustomerUsecase

func NewCustomerUsecase(repo CustomerRepo, logger log.Logger) *CustomerUsecase

func (*CustomerUsecase) Create

func (uc *CustomerUsecase) Create(ctx context.Context, member *Customer) (*Customer, error)

创建用户

func (*CustomerUsecase) Delete

func (uc *CustomerUsecase) Delete(ctx context.Context, ids []int64) error

删除用户

func (*CustomerUsecase) Get

func (uc *CustomerUsecase) Get(ctx context.Context, id int64) (p *Customer, err error)

func (*CustomerUsecase) List

func (uc *CustomerUsecase) List(ctx context.Context, req *pb.CustomerListOption) (ps []*Customer, err error)

func (*CustomerUsecase) Login

func (uc *CustomerUsecase) Login(ctx context.Context, account, password string) (token string, expireTime int64, m *Customer, err error)

登录

func (*CustomerUsecase) Update

func (uc *CustomerUsecase) Update(ctx context.Context, id int64, member *Customer) (*Customer, error)

更新用户

Jump to

Keyboard shortcuts

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