Documentation ¶
Index ¶
- Variables
- func QueryCount(db *gorm.DB) (int64, error)
- func QueryPage(db *gorm.DB, pp dto.PaginationParams, out interface{}) (int64, error)
- func QueryPagination(db *gorm.DB, pp dto.PaginationParams, out interface{}) (*dto.Pagination, error)
- type BlogPostRepository
- func (b BlogPostRepository) Create(post *models.BlogPost) error
- func (b BlogPostRepository) Delete(post *models.BlogPost) error
- func (b BlogPostRepository) Get(id uint) (*models.BlogPost, error)
- func (b BlogPostRepository) Query(params *dto.BlogPostQueryParams) (*models.BlogPosts, *dto.Pagination, error)
- func (b BlogPostRepository) QueryByFollowing(user *models.User, params *dto.BlogPostQueryParams) (*models.BlogPosts, *dto.Pagination, error)
- func (b BlogPostRepository) Update(postID uint, post *models.BlogPost) error
- type CommentRepository
- func (b CommentRepository) Create(comment *models.Comment) error
- func (b CommentRepository) Delete(comment *models.Comment) error
- func (b CommentRepository) Get(id uint) (*models.Comment, error)
- func (b CommentRepository) Query(params *dto.CommentQueryParams) (*models.Comments, *dto.Pagination, error)
- func (b CommentRepository) Update(commentID uint, comment *models.Comment) error
- type FollowerRepository
- type UserRepository
- func (r UserRepository) Create(user *models.User) error
- func (r UserRepository) Get(id uint) (*models.User, error)
- func (r UserRepository) GetByEmail(email string) (*models.User, error)
- func (r UserRepository) Query(params *dto.UserQueryParams) (*models.Users, *dto.Pagination, error)
- func (r UserRepository) Update(user *models.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "repositories", fx.Provide(NewUserRepository), fx.Provide(NewBlogPostRepository), fx.Provide(NewCommentRepository), fx.Provide(NewFollowerRepository), )
Functions ¶
func QueryPagination ¶
func QueryPagination(db *gorm.DB, pp dto.PaginationParams, out interface{}) (*dto.Pagination, error)
Types ¶
type BlogPostRepository ¶
func NewBlogPostRepository ¶
func NewBlogPostRepository(db lib.Database) BlogPostRepository
func (BlogPostRepository) Query ¶
func (b BlogPostRepository) Query(params *dto.BlogPostQueryParams) (*models.BlogPosts, *dto.Pagination, error)
func (BlogPostRepository) QueryByFollowing ¶
func (b BlogPostRepository) QueryByFollowing(user *models.User, params *dto.BlogPostQueryParams) (*models.BlogPosts, *dto.Pagination, error)
type CommentRepository ¶
func NewCommentRepository ¶
func NewCommentRepository(db lib.Database) CommentRepository
func (CommentRepository) Query ¶
func (b CommentRepository) Query(params *dto.CommentQueryParams) (*models.Comments, *dto.Pagination, error)
type FollowerRepository ¶
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 ¶
func NewUserRepository ¶
func NewUserRepository(db lib.Database) UserRepository
func (UserRepository) GetByEmail ¶
func (r UserRepository) GetByEmail(email string) (*models.User, error)
func (UserRepository) Query ¶
func (r UserRepository) Query(params *dto.UserQueryParams) (*models.Users, *dto.Pagination, error)
Click to show internal directories.
Click to hide internal directories.