repositories

package
v0.0.0-...-042b7a9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func QueryCount

func QueryCount(db *gorm.DB) (int64, error)

func QueryPage

func QueryPage(db *gorm.DB, pp dto.PaginationParams, out interface{}) (int64, error)

func QueryPagination

func QueryPagination(db *gorm.DB, pp dto.PaginationParams, out interface{}) (*dto.Pagination, error)

Types

type BlogPostRepository

type BlogPostRepository struct {
	Db lib.Database
}

func NewBlogPostRepository

func NewBlogPostRepository(db lib.Database) BlogPostRepository

func (BlogPostRepository) Create

func (b BlogPostRepository) Create(post *models.BlogPost) error

func (BlogPostRepository) Delete

func (b BlogPostRepository) Delete(post *models.BlogPost) error

func (BlogPostRepository) Get

func (BlogPostRepository) Query

func (BlogPostRepository) QueryByFollowing

func (b BlogPostRepository) QueryByFollowing(user *models.User, params *dto.BlogPostQueryParams) (*models.BlogPosts, *dto.Pagination, error)

func (BlogPostRepository) Update

func (b BlogPostRepository) Update(postID uint, post *models.BlogPost) error

type CommentRepository

type CommentRepository struct {
	Db lib.Database
}

func NewCommentRepository

func NewCommentRepository(db lib.Database) CommentRepository

func (CommentRepository) Create

func (b CommentRepository) Create(comment *models.Comment) error

func (CommentRepository) Delete

func (b CommentRepository) Delete(comment *models.Comment) error

func (CommentRepository) Get

func (b CommentRepository) Get(id uint) (*models.Comment, error)

func (CommentRepository) Query

func (CommentRepository) Update

func (b CommentRepository) Update(commentID uint, comment *models.Comment) error

type FollowerRepository

type FollowerRepository struct {
	Db lib.Database
}

func NewFollowerRepository

func NewFollowerRepository(db lib.Database) FollowerRepository

func (FollowerRepository) Create

func (r FollowerRepository) Create(follower *models.Follower) error

func (FollowerRepository) Delete

func (r FollowerRepository) Delete(follower *models.Follower) error

func (FollowerRepository) HasFollowing

func (r FollowerRepository) HasFollowing(userID uint, followingID uint) error

type UserRepository

type UserRepository struct {
	Db lib.Database
}

func NewUserRepository

func NewUserRepository(db lib.Database) UserRepository

func (UserRepository) Create

func (r UserRepository) Create(user *models.User) error

func (UserRepository) Get

func (r UserRepository) Get(id uint) (*models.User, error)

func (UserRepository) GetByEmail

func (r UserRepository) GetByEmail(email string) (*models.User, error)

func (UserRepository) Query

func (UserRepository) Update

func (r UserRepository) Update(user *models.User) error

Jump to

Keyboard shortcuts

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