repository

package
v0.0.0-...-3daaeb3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostRepo

type PostRepo struct {
	DB     *gorm.DB
	Cfg    *configs.Configs
	Logger *logrus.Logger
}

func (*PostRepo) Create

func (r *PostRepo) Create(ctx context.Context, req dto.PostCreateReq) (*dto.PostRes, error)

func (*PostRepo) DeleteByID

func (r *PostRepo) DeleteByID(ctx context.Context, postID uint64) error

func (*PostRepo) GetAll

func (r *PostRepo) GetAll(ctx context.Context) (result []dto.PostRes, err error)

func (*PostRepo) GetDetail

func (r *PostRepo) GetDetail(ctx context.Context, req dto.PostGetReq) (*dto.PostRes, error)

func (*PostRepo) GetDetailTag

func (r *PostRepo) GetDetailTag(ctx context.Context, req dto.TagGetReq) (*models.Tag, error)

func (*PostRepo) UpdateByID

func (r *PostRepo) UpdateByID(ctx context.Context, req dto.PostUpdateReq) error

type PostRepository

type PostRepository interface {
	GetAll(ctx context.Context) (result []dto.PostRes, err error)
	GetDetail(ctx context.Context, req dto.PostGetReq) (*dto.PostRes, error)
	GetDetailTag(ctx context.Context, req dto.TagGetReq) (*models.Tag, error)
	Create(ctx context.Context, req dto.PostCreateReq) (*dto.PostRes, error)
	DeleteByID(ctx context.Context, postID uint64) error
	UpdateByID(ctx context.Context, req dto.PostUpdateReq) error
}

func NewPostRepository

func NewPostRepository(
	db *gorm.DB,
	cfg *configs.Configs,
	logger *logrus.Logger,
) PostRepository

type Repositories

type Repositories struct {
	Post PostRepository
}

Repositories all repo object injected here

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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