service

package
v0.0.0-...-2cadb06 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserDuplicateEmail = repository.ErrUserDuplicateEmail
	ErrUserNotFound       = repository.ErrUserNotFound
	ErrInvalidUserOrEmail = errors.New("邮箱或密码不对")
)

Functions

This section is empty.

Types

type ArticleService

type ArticleService interface {
	Save(ctx context.Context, article *domain.Article) (int64, error)
	Create(ctx context.Context, article *domain.Article) (int64, error)
	Update(ctx context.Context, article *domain.Article) error
	Publish(ctx context.Context, article *domain.Article) (int64, error)
	List(ctx context.Context, offset int, limit int) ([]domain.Article, error)
}

func NewArticleService

func NewArticleService(repo repository.ArticleRepository, l *zap.Logger) ArticleService

type ArticleServiceImpl

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

func (*ArticleServiceImpl) Create

func (svc *ArticleServiceImpl) Create(ctx context.Context, article *domain.Article) (int64, error)

func (*ArticleServiceImpl) List

func (svc *ArticleServiceImpl) List(ctx context.Context, offset int, limit int) ([]domain.Article, error)

func (*ArticleServiceImpl) Publish

func (svc *ArticleServiceImpl) Publish(ctx context.Context, article *domain.Article) (int64, error)

func (*ArticleServiceImpl) Save

func (svc *ArticleServiceImpl) Save(ctx context.Context, article *domain.Article) (int64, error)

func (*ArticleServiceImpl) Update

func (svc *ArticleServiceImpl) Update(ctx context.Context, article *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(repo repository.CodeRepository, smsSvc sms.SmsService, l *zap.Logger) CodeService

type CodeServiceImpl

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

func (*CodeServiceImpl) Send

func (svc *CodeServiceImpl) Send(ctx context.Context,

	biz string,
	phone string) error

Send 发验证码 我需要什么参数

func (*CodeServiceImpl) Verify

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

type InteractiveService

type InteractiveService interface {
	IncreaseReadCount(ctx context.Context, biz string, bizId int64) error
	IncreaseLikeCount(ctx *gin.Context, biz string, bizId int64, uid int64) error
}

type InteractiveServiceImpl

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

func NewInteractiveServiceImpl

func NewInteractiveServiceImpl() *InteractiveServiceImpl

func (*InteractiveServiceImpl) IncreaseLikeCount

func (svc *InteractiveServiceImpl) IncreaseLikeCount(ctx *gin.Context, biz string, bizId int64, uid int64) error

func (*InteractiveServiceImpl) IncreaseReadCount

func (svc *InteractiveServiceImpl) IncreaseReadCount(ctx context.Context, biz string, bizId int64) error

type UserService

type UserService interface {
	Login(ctx context.Context, email, password string) (domain.User, error)
	SignUp(ctx context.Context, u domain.User) error
	Profile(ctx context.Context, id int64) (domain.User, error)
	FindOrCreate(ctx context.Context, phone string) (domain.User, error)
}

func NewUserService

func NewUserService(repo repository.UserRepository, l *zap.Logger) UserService

type UserServiceImpl

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

func (UserServiceImpl) FindOrCreate

func (svc UserServiceImpl) FindOrCreate(ctx context.Context, phone string) (domain.User, error)

func (*UserServiceImpl) Login

func (svc *UserServiceImpl) Login(ctx context.Context, email, password string) (domain.User, error)

func (*UserServiceImpl) Profile

func (svc *UserServiceImpl) Profile(ctx context.Context, id int64) (domain.User, error)

func (*UserServiceImpl) SignUp

func (svc *UserServiceImpl) SignUp(ctx context.Context, u domain.User) error

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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