Documentation ¶
Index ¶
- Variables
- type ArticleRepository
- type ArticleRepositoryImpl
- func (repo *ArticleRepositoryImpl) Create(ctx context.Context, article *domain.Article) (int64, error)
- func (repo *ArticleRepositoryImpl) List(ctx context.Context, offset int, limit int) ([]domain.Article, error)
- func (repo *ArticleRepositoryImpl) Sync(ctx context.Context, article *domain.Article) (int64, error)
- func (repo *ArticleRepositoryImpl) Update(ctx context.Context, article *domain.Article) error
- type CodeRepository
- type CodeRepositoryImpl
- type InteractiveRepository
- type InteractiveRepositoryImpl
- type UserRepository
- type UserRepositoryImpl
- func (r *UserRepositoryImpl) Create(ctx context.Context, u domain.User) error
- func (r *UserRepositoryImpl) Domain2Entity(u domain.User) dao.User
- func (r *UserRepositoryImpl) Entity2Domain(u dao.User) domain.User
- func (r *UserRepositoryImpl) FindByEmail(ctx context.Context, email string) (domain.User, error)
- func (r *UserRepositoryImpl) FindById(ctx context.Context, id int64) (domain.User, error)
- func (r *UserRepositoryImpl) FindByPhone(ctx context.Context, phone string) (domain.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeSendToMany = cache.ErrSetCodeTooMany ErrCodeVerifyTooManyTimes = cache.ErrCodeVerifyTooManyTimes )
View Source
var ( ErrUserDuplicateEmail = dao.ErrUserDuplicateEmail ErrUserNotFound = dao.ErrUserNotFound )
Functions ¶
This section is empty.
Types ¶
type ArticleRepository ¶
type ArticleRepository interface { Create(ctx context.Context, article *domain.Article) (int64, error) Update(ctx context.Context, article *domain.Article) error Sync(ctx context.Context, article *domain.Article) (int64, error) List(ctx context.Context, offset int, limit int) ([]domain.Article, error) }
func NewArticleRepository ¶
func NewArticleRepository(dao article.ArticleDao, cache cache.ArticleCache, logger *zap.Logger) ArticleRepository
type ArticleRepositoryImpl ¶
type ArticleRepositoryImpl struct {
// contains filtered or unexported fields
}
type CodeRepository ¶
type CodeRepository interface { Store(ctx context.Context, biz, phone, code string) error Verify(ctx context.Context, biz, phone, inputCode string) (bool, error) }
func NewCodeRepository ¶
func NewCodeRepository(c *cache.CodeCache, l *zap.Logger) CodeRepository
type CodeRepositoryImpl ¶
type CodeRepositoryImpl struct {
// contains filtered or unexported fields
}
type InteractiveRepository ¶
type InteractiveRepositoryImpl ¶
type InteractiveRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewInteractiveRepositoryImpl ¶
func NewInteractiveRepositoryImpl() *InteractiveRepositoryImpl
func (*InteractiveRepositoryImpl) IncreaseLikeCount ¶
func (*InteractiveRepositoryImpl) IncreaseReadCount ¶
type UserRepository ¶
type UserRepository interface { FindByEmail(ctx context.Context, email string) (domain.User, error) Create(ctx context.Context, user domain.User) error FindById(ctx context.Context, id int64) (domain.User, error) FindByPhone(ctx context.Context, phone string) (domain.User, error) }
func NewUserRepository ¶
type UserRepositoryImpl ¶
type UserRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*UserRepositoryImpl) Domain2Entity ¶
func (r *UserRepositoryImpl) Domain2Entity(u domain.User) dao.User
func (*UserRepositoryImpl) Entity2Domain ¶
func (r *UserRepositoryImpl) Entity2Domain(u dao.User) domain.User
func (*UserRepositoryImpl) FindByEmail ¶
func (*UserRepositoryImpl) FindByPhone ¶
Directories ¶
Path | Synopsis |
---|---|
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.