repository

package
v0.0.0-...-a783adc Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 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 IPostRepository

type IPostRepository interface {
	GetLatest5Posts(ctx context.Context) ([]*domain.Post, error)
	QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)
	GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)
	IncreaseVisitCount(ctx context.Context, id string) error
	HadLikePost(ctx context.Context, id string, ip string) (bool, error)
	AddLike(ctx context.Context, id string, ip string) error
	DeleteLike(ctx context.Context, id string, ip string) error
	IncreaseCommentCount(ctx context.Context, id string) error
}

type PostRepository

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

func NewPostRepository

func NewPostRepository(dao dao.IPostDao) *PostRepository

func (*PostRepository) AddLike

func (r *PostRepository) AddLike(ctx context.Context, id string, ip string) error

func (*PostRepository) DeleteLike

func (r *PostRepository) DeleteLike(ctx context.Context, id string, ip string) error

func (*PostRepository) GetLatest5Posts

func (r *PostRepository) GetLatest5Posts(ctx context.Context) ([]*domain.Post, error)

func (*PostRepository) GetPunishedPostById

func (r *PostRepository) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)

func (*PostRepository) HadLikePost

func (r *PostRepository) HadLikePost(ctx context.Context, id string, ip string) (bool, error)

func (*PostRepository) IncreaseCommentCount

func (r *PostRepository) IncreaseCommentCount(ctx context.Context, id string) error

func (*PostRepository) IncreaseVisitCount

func (r *PostRepository) IncreaseVisitCount(ctx context.Context, id string) error

func (*PostRepository) QueryPostsPage

func (r *PostRepository) QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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