Documentation ¶
Index ¶
- Variables
- type ArticleService
- type ArticleServiceImpl
- func (svc *ArticleServiceImpl) Create(ctx context.Context, article *domain.Article) (int64, error)
- func (svc *ArticleServiceImpl) List(ctx context.Context, offset int, limit int) ([]domain.Article, error)
- func (svc *ArticleServiceImpl) Publish(ctx context.Context, article *domain.Article) (int64, error)
- func (svc *ArticleServiceImpl) Save(ctx context.Context, article *domain.Article) (int64, error)
- func (svc *ArticleServiceImpl) Update(ctx context.Context, article *domain.Article) error
- type CodeService
- type CodeServiceImpl
- type InteractiveService
- type InteractiveServiceImpl
- type UserService
- type UserServiceImpl
- func (svc UserServiceImpl) FindOrCreate(ctx context.Context, phone string) (domain.User, error)
- func (svc *UserServiceImpl) Login(ctx context.Context, email, password string) (domain.User, error)
- func (svc *UserServiceImpl) Profile(ctx context.Context, id int64) (domain.User, error)
- func (svc *UserServiceImpl) SignUp(ctx context.Context, u domain.User) error
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
}
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
}
type InteractiveService ¶
type InteractiveServiceImpl ¶
type InteractiveServiceImpl struct {
// contains filtered or unexported fields
}
func NewInteractiveServiceImpl ¶
func NewInteractiveServiceImpl() *InteractiveServiceImpl
func (*InteractiveServiceImpl) IncreaseLikeCount ¶
func (*InteractiveServiceImpl) IncreaseReadCount ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.