service

package
v0.0.0-...-02d2a03 Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeSendTooMany        = repository.ErrCodeSendTooMany
	ErrCodeVerifyTooManyTimes = repository.ErrCodeVerifyTooManyTimes
)
View Source
var (
	ErrDuplicateEmail        = repository.ErrDuplicateEmail
	ErrInvalidUserOrPassword = errors.New("账号/邮箱或密码不对")
)

Functions

This section is empty.

Types

type ArticleService

type ArticleService interface {
	Save(ctx context.Context, article domain.Article) (int64, error)
	Publish(ctx context.Context, article domain.Article) (int64, error)
	WithDraw(ctx context.Context, article domain.Article) error
	List(ctx context.Context, userId int64, offset, limit int) ([]domain.Article, error)
	GetByArtId(ctx context.Context, id int64) (domain.Article, error)
	GetPubByArtId(ctx context.Context, id int64) (domain.Article, error)
}

type CodeService

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

func NewCodeService

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

type CodeServiceX

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

func (*CodeServiceX) Send

func (csv *CodeServiceX) Send(ctx context.Context, biz string, phone string) error

func (*CodeServiceX) Verify

func (csv *CodeServiceX) Verify(ctx context.Context, biz string, phone string, inputCode string) (bool, error)

type UserService

type UserService interface {
	SignUp(ctx context.Context, user domain.User) error
	Login(ctx context.Context, user domain.User) (domain.User, error)
	FindOrCreate(ctx context.Context, phone string) (domain.User, error)
	Edit(ctx context.Context, user domain.User) error
}

func NewUserService

func NewUserService(repo repository.UserRepository) UserService

type UserServiceX

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

func (*UserServiceX) Edit

func (s *UserServiceX) Edit(ctx context.Context, user domain.User) error

func (*UserServiceX) FindOrCreate

func (s *UserServiceX) FindOrCreate(ctx context.Context, phone string) (domain.User, error)

func (*UserServiceX) Login

func (s *UserServiceX) Login(ctx context.Context, user domain.User) (domain.User, error)

func (*UserServiceX) SignUp

func (s *UserServiceX) SignUp(ctx context.Context, user domain.User) error

Directories

Path Synopsis
Package svcmocks is a generated GoMock package.
Package svcmocks is a generated GoMock package.
sms
sms -- short message service
sms -- short message service
mem

Jump to

Keyboard shortcuts

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