biz

package
v0.0.0-...-9bd63dd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 6 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type AccountUser

type AccountUser struct {
	Id            int64
	Username      string
	Password      string `json:"-"`
	Phone         string
	Email         string
	CreateAt      time.Time
	CreateIPAt    string
	LastLoginAt   time.Time
	LastLoginIPAt string
	LoginTimes    int32
	Status        int8
}

func (*AccountUser) CheckPassword

func (au *AccountUser) CheckPassword(password string) bool

func (*AccountUser) SetPassword

func (au *AccountUser) SetPassword(password string)

type AccountUserListReq

type AccountUserListReq struct {
	PageNum  int64
	PageSize int64
}

type AccountUserListResp

type AccountUserListResp struct {
	TotalPages  int64
	CurrentPage int64
	PageSize    int64
	Data        []*AccountUser
}

type AccountUserRepo

type AccountUserRepo interface {
	Register(ctx context.Context, au *AccountUser) (int64, error)
	GetAccountUserByUsernameOrMobileOrEmail(ctx context.Context, account string) ([]*AccountUser, error)

	Create(ctx context.Context, au *AccountUser) (int64, error)
	Update(ctx context.Context, au *AccountUser) error
	Delete(ctx context.Context, id int64) error
	Get(ctx context.Context, id int64) (*AccountUser, error)
	List(ctx context.Context, req *AccountUserListReq) (*AccountUserListResp, error)
}

type AccountUserUseCase

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

func NewAccountUserUseCase

func NewAccountUserUseCase(repo AccountUserRepo, logger log.Logger) *AccountUserUseCase

func (*AccountUserUseCase) Create

func (uc *AccountUserUseCase) Create(ctx context.Context, au *AccountUser) (int64, error)

func (*AccountUserUseCase) Delete

func (uc *AccountUserUseCase) Delete(ctx context.Context, id int64) error

func (*AccountUserUseCase) Get

func (*AccountUserUseCase) List

func (*AccountUserUseCase) Login

func (uc *AccountUserUseCase) Login(ctx context.Context, account, password string) (*AccountUser, error)

func (*AccountUserUseCase) Register

func (uc *AccountUserUseCase) Register(ctx context.Context, au *AccountUser) (*AccountUser, error)

func (*AccountUserUseCase) Update

func (uc *AccountUserUseCase) Update(ctx context.Context, au *AccountUser) error

func (*AccountUserUseCase) UpdateAccountUser

func (uc *AccountUserUseCase) UpdateAccountUser(ctx context.Context, id int64, au *AccountUser) (*AccountUser, error)

Jump to

Keyboard shortcuts

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