Documentation
¶
Index ¶
- Variables
- type ArticleService
- type CodeService
- type CodeServiceX
- type UserService
- type UserServiceX
- func (s *UserServiceX) Edit(ctx context.Context, user domain.User) error
- func (s *UserServiceX) FindOrCreate(ctx context.Context, phone string) (domain.User, error)
- func (s *UserServiceX) Login(ctx context.Context, user domain.User) (domain.User, error)
- func (s *UserServiceX) SignUp(ctx context.Context, user domain.User) error
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)
}
func NewArticleService ¶
func NewArticleService(repo repository.ArticleRepository, pro article.Producer) ArticleService
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
}
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) FindOrCreate ¶
Click to show internal directories.
Click to hide internal directories.