Versions in this module Expand all Collapse all v0 v0.0.2 Aug 2, 2024 v0.0.1 Aug 2, 2024 Changes in this version + type CommentRepository interface + Create func(comment *models.Comment) error + DeleteById func(cid uint) error + DeleteByIdAndUserId func(cid uint, uid uint) error + Get func(cid uint) (*models.Comment, error) + GetByPostId func(pid uint, count uint) ([]*models.Comment, error) + GetByPostIdAndIsApproved func(pid uint, isApproved bool, count uint) ([]*models.Comment, error) + List func(page, pageSize uint) ([]*models.Comment, error) + ListByUserId func(uid, page, pageSize uint) ([]*models.Comment, error) + Update func(comment *models.Comment) error + func NewCommentRepository(db *gorm.DB) CommentRepository + type LikeRepository interface + Create func(comment *models.Like) error + DeleteById func(lid uint) error + Get func(lid uint) (*models.Like, error) + GetByIPAndPostId func(ip string, pid uint) (*models.Like, error) + GetByPostId func(pid uint) ([]*models.Like, error) + GetByUserIdAndPostId func(uid uint, pid uint) (*models.Like, error) + VisitorLikeCount func(pid uint) (uint, error) + func NewLikeRepository(db *gorm.DB) LikeRepository + type PostRepository interface + BatchUpdateApprovedStatusByUid func(uid uint, newStatus bool) error + BatchUpdatePriorityByUid func(uid uint, newPriority uint) error + Create func(post *models.Post) error + DeleteByIdAndUserId func(pid uint, uid uint) error + Get func(pid uint) (*models.Post, error) + List func(page, pageSize uint) ([]*models.Post, error) + ListByUserId func(uid uint, page, pageSize uint) ([]*models.Post, error) + ListByUserIdAndVisibility func(uid uint, visibility models.Visibility, page, pageSize uint) ([]*models.Post, error) + Update func(post *models.Post) error + func NewPostRepository(db *gorm.DB) PostRepository + type UserProfileRepository interface + Create func(userProfile *models.UserProfile) error + FindByUserId func(userId uint) (*models.UserProfile, error) + Update func(userProfile *models.UserProfile) error + func NewUserProfileRepository(db *gorm.DB) UserProfileRepository + type UserRepository interface + Count func() (uint, error) + Create func(user *models.User) error + FindAdmin func() (*models.User, error) + FindByEmail func(email string) (*models.User, error) + FindByEmailAndPassword func(email string, password string) (*models.User, error) + FindById func(id uint) (*models.User, error) + ForceDelete func(userid uint) error + ListAll func() ([]*models.SimpleUser, error) + Update func(user *models.User) error + UpdatePassword func(userid uint, password string) error + func NewUserRepository(db *gorm.DB) UserRepository