repository

package
v0.0.0-...-05f445e Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleRepository

type ArticleRepository interface {
	Create(ctx context.Context, art article.Article) (int64, error)
	Update(ctx context.Context, art article.Article) error
}

func NewArticleRepository

func NewArticleRepository(dao article.ArticleDAO) ArticleRepository

type CachedArticleRepository

type CachedArticleRepository struct {
	// contains filtered or unexported fields
}

func (*CachedArticleRepository) Create

func (*CachedArticleRepository) Update

type CachedMsUserRepository

type CachedMsUserRepository struct {
	// contains filtered or unexported fields
}

func (*CachedMsUserRepository) Create

func (repo *CachedMsUserRepository) Create(ctx context.Context, u MsUser) error

func (*CachedMsUserRepository) FindByUsername

func (repo *CachedMsUserRepository) FindByUsername(ctx context.Context, username string) (MsUser, error)

type CachedUserRepository

type CachedUserRepository struct {
	// contains filtered or unexported fields
}

func (*CachedUserRepository) Create

func (repo *CachedUserRepository) Create(ctx context.Context, u User) error

func (*CachedUserRepository) EditProfile

func (repo *CachedUserRepository) EditProfile(ctx context.Context, u User) (User, error)

func (*CachedUserRepository) FindByEmail

func (repo *CachedUserRepository) FindByEmail(ctx context.Context, email string) (User, error)

func (*CachedUserRepository) FindById

func (repo *CachedUserRepository) FindById(ctx context.Context, uid int64) (User, error)

func (*CachedUserRepository) FindByPhone

func (repo *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (User, error)

func (*CachedUserRepository) FindByWechat

func (r *CachedUserRepository) FindByWechat(ctx context.Context, openID string) (User, error)

type CaptchaRepository

type CaptchaRepository interface {
	Store(ctx context.Context, biz string, phone string, captcha string) error
	Verify(ctx context.Context, biz string, phone string, inputcode string) (bool, error)
}

func NewCaptchaRepository

func NewCaptchaRepository(c cache.CaptchaCache) CaptchaRepository

type MsUser

type MsUser struct {
	Id    int64
	Phone string
	Email string

	// encrypted password
	Password string

	Username string
	Profile  string

	Birthday time.Time
}

type MsUserRepository

type MsUserRepository interface {
	Create(ctx context.Context, u MsUser) error
	FindByUsername(ctx context.Context, username string) (MsUser, error)
}

func NewMsUserRepository

func NewMsUserRepository(dao dao.MsUserDAO) MsUserRepository

type User

type User struct {
	Id          int64
	WechaOpenId string
	Phone       string
	Email       string

	// encrypted password
	Password string

	Nickname string
	Profile  string

	Birthday time.Time
}

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, u User) error
	FindById(ctx context.Context, uid int64) (User, error)
	FindByEmail(ctx context.Context, email string) (User, error)
	FindByPhone(ctx context.Context, phone string) (User, error)
	FindByWechat(ctx context.Context, openID string) (User, error)
	EditProfile(ctx context.Context, u User) (User, error)
}

func NewUserRepository

func NewUserRepository(dao dao.UserDAO, cache cache.UserCache) UserRepository

Directories

Path Synopsis
mocks
Package cachemock is a generated GoMock package.
Package cachemock is a generated GoMock package.
redismocks
Package redismocks is a generated GoMock package.
Package redismocks is a generated GoMock package.
dao
mocks
Package daomock is a generated GoMock package.
Package daomock is a generated GoMock package.
Package repomock is a generated GoMock package.
Package repomock is a generated GoMock package.

Jump to

Keyboard shortcuts

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