service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleService

type ArticleService interface {
	Save(ctx context.Context, art domain.Article) (int64, error)
	Publish(ctx context.Context, art domain.Article) (int64, error)
	Withdraw(ctx context.Context, uid, id int64) error
	List(ctx context.Context, uid int64, page int64, pageSize int64) ([]domain.Article, error)
	Detail(ctx context.Context, uid int64, id int64) (domain.Article, error)
	PubDetail(ctx context.Context, uid int64, id int64, biz string) (domain.Article, error)
	GetHistory(ctx context.Context, user int64) ([]domain.Article, error)
}

func NewArticleService

func NewArticleService(repo repository.ArticleRepository, userRepo repository.UserRepository, producer article.Producer, historyRepo repository.HistoryRepository, historyProducer history.Producer, l log.Logger) ArticleService

type CodeService

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

func NewCodeService

func NewCodeService(repo repository.CodeRepository, smsService sms.SMSService) CodeService

type InteractiveService

type InteractiveService interface {
	IncrReadCnt(ctx context.Context, bizID int64, biz string) error
	Like(ctx context.Context, userID, bizID int64, biz string) error
	CancelLike(ctx context.Context, userID, bizID int64, biz string) error
	Collect(ctx context.Context, uid int64, id int64, cid int64, biz string) error
	Get(ctx context.Context, uid int64, id int64, biz string) (domain.Interactive, error)
}

type UserService

type UserService interface {
	Signup(ctx context.Context, email, password string) error
	Login(ctx context.Context, email, password string) (domain.User, error)
	UpdateUserInfo(ctx context.Context, user domain.User) error
	GetUserInfo(ctx context.Context, id int64) (domain.User, error)
	GetUserList(ctx context.Context, page, pageSize int) ([]domain.User, int, error)
	LoginSMS(ctx context.Context, phone string, code string) (domain.User, error)
}

func NewUserService

func NewUserService(repo repository.UserRepository) UserService

Directories

Path Synopsis
Package mocksvc is a generated GoMock package.
Package mocksvc is a generated GoMock package.
sms

Jump to

Keyboard shortcuts

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