repository

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 6 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 domain.Article) (int64, error)
	Update(ctx context.Context, art domain.Article) error
	Sync(ctx context.Context, art domain.Article) (int64, error)
	SyncStatus(ctx context.Context, uid int64, id int64, status domain.ArticleStatus) error
	ListByAuthor(ctx context.Context, uid int64, page int64, pageSize int64) ([]domain.Article, error)
	GetById(ctx context.Context, uid int64, id int64) (domain.Article, error)
	GetPubById(ctx context.Context, uid int64, id int64) (domain.Article, error)
}

func NewArticleRepository

func NewArticleRepository(dao dao.ArticleDao, cache cache.ArticleCache) ArticleRepository

type CodeRepository

type CodeRepository interface {
	Set(ctx context.Context, biz, phone, code string) error
	Verify(ctx context.Context, biz, phone, code string) (bool, error)
}

func NewCodeRepository

func NewCodeRepository(cache cache.CodeCache) CodeRepository

type HistoryRepository

type HistoryRepository interface {
	GetListByUser(ctx context.Context, userID int64) ([]domain.History, error)
	Create(ctx context.Context, history domain.History) error
}

func NewHistoryRepository

func NewHistoryRepository(dao dao.HistoryDao) HistoryRepository

type InteractiveRepository

type InteractiveRepository interface {
	IncrReadCnt(ctx context.Context, bizID int64, biz string) error
	IncrLikeCnt(ctx context.Context, userID, bizID int64, biz string) error
	DecrLikeCnt(ctx context.Context, userID, bizID int64, biz string) error
	AddCollectItem(ctx context.Context, uid int64, id int64, cid int64, biz string) error
	Get(ctx context.Context, id int64, biz string) (domain.Interactive, error)
	Liked(ctx context.Context, uid int64, id int64, biz string) (bool, error)
	Collect(ctx context.Context, uid int64, id int64, biz string) (bool, error)
}

type UserRepository

type UserRepository interface {
	FindByEmail(ctx context.Context, email string) (domain.User, error)
	Insert(ctx context.Context, user domain.User) error
	FindById(ctx context.Context, id int64) (domain.User, error)
	UpdateByID(ctx context.Context, user domain.User) error
	GetUserList(ctx context.Context, page, pageSize int) ([]domain.User, int, error)
	FindOrCreateByPhone(ctx context.Context, phone string) (domain.User, error)
}

func NewUserRepository

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

Directories

Path Synopsis
Package repomocks is a generated GoMock package.
Package repomocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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