Documentation ¶
Index ¶
- Variables
- func PathsDownGrade(ctx context.Context, quick, slow func())
- type ArticleService
- func NewArticleService(repo article.ArticleRepository, l logger.LoggerV1, producer events.Producer) ArticleService
- func NewArticleServiceV1(author article.ArticleAuthorRepository, reader article.ArticleReaderRepository, ...) ArticleService
- func NewArticleServiceV2(repo article.ArticleRepository, l logger.LoggerV1, producer events.Producer) ArticleService
- type BatchRankingService
- type CodeService
- type InteractiveService
- type JobService
- type RankingService
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeVerifyTooManyTimes = repository.ErrCodeVerifyTooManyTimes ErrCodeSendTooMany = repository.ErrCodeSendTooMany )
View Source
var ErrInvalidUserOrPassword = errors.New("账号/邮箱或密码不对")
View Source
var ErrUserDuplicateEmail = repository.ErrUserDuplicate
Functions ¶
func PathsDownGrade ¶
Types ¶
type ArticleService ¶
type ArticleService interface { Save(ctx context.Context, art domain.Article) (int64, error) Withdraw(ctx context.Context, art domain.Article) error Publish(ctx context.Context, art domain.Article) (int64, error) PublishV1(ctx context.Context, art domain.Article) (int64, error) List(ctx context.Context, uid int64, offset int, limit int) ([]domain.Article, error) // ListPub 根据这个 start 时间来查询 ListPub(ctx context.Context, start time.Time, offset, limit int) ([]domain.Article, error) GetById(ctx context.Context, id int64) (domain.Article, error) GetPublishedById(ctx context.Context, id, uid int64) (domain.Article, error) }
func NewArticleService ¶
func NewArticleService(repo article.ArticleRepository, l logger.LoggerV1, producer events.Producer) ArticleService
func NewArticleServiceV1 ¶
func NewArticleServiceV1(author article.ArticleAuthorRepository, reader article.ArticleReaderRepository, l logger.LoggerV1) ArticleService
func NewArticleServiceV2 ¶
func NewArticleServiceV2(repo article.ArticleRepository, l logger.LoggerV1, producer events.Producer) ArticleService
type BatchRankingService ¶
type BatchRankingService 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.Service) CodeService
type InteractiveService ¶
type InteractiveService interface { IncrReadCnt(ctx context.Context, biz string, bizId int64) error // Like 点赞 Like(ctx context.Context, biz string, bizId int64, uid int64) error // CancelLike 取消点赞 CancelLike(ctx context.Context, biz string, bizId int64, uid int64) error // Collect 收藏, cid 是收藏夹的 ID // cid 不一定有,或者说 0 对应的是该用户的默认收藏夹 Collect(ctx context.Context, biz string, bizId, cid, uid int64) error Get(ctx context.Context, biz string, bizId, uid int64) (domain.Interactive, error) GetByIds(ctx context.Context, biz string, bizIds []int64) (map[int64]domain.Interactive, error) }
func NewInteractiveService ¶
func NewInteractiveService(repo repository.InteractiveRepository, l logger.LoggerV1) InteractiveService
type JobService ¶
type RankingService ¶
func NewBatchRankingService ¶
func NewBatchRankingService(artSvc ArticleService, intrSvc InteractiveService) RankingService
type UserService ¶
type UserService interface { Login(ctx context.Context, email, password string) (domain.User, error) SignUp(ctx context.Context, u domain.User) error FindOrCreate(ctx context.Context, phone string) (domain.User, error) FindOrCreateByWechat(ctx context.Context, wechatInfo domain.WechatInfo) (domain.User, error) Profile(ctx context.Context, id int64) (domain.User, error) }
func NewUserService ¶
func NewUserService(repo repository.UserRepository, l logger.LoggerV1) UserService
NewUserService 我用的人,只管用,怎么初始化我不管,我一点都不关心如何初始化
func NewUserServiceV1 ¶
func NewUserServiceV1(repo repository.UserRepository, l *zap.Logger) UserService
Click to show internal directories.
Click to hide internal directories.