Add activities page.

This commit is contained in:
2025-06-13 19:32:25 +08:00
parent 0b3b54a0c4
commit 1f238c56f3
18 changed files with 424 additions and 70 deletions

View File

@@ -62,3 +62,11 @@ func GetCommentsWithUser(username string, page, pageSize int) ([]model.Comment,
totalPages := (int(total) + pageSize - 1) / pageSize
return comments, totalPages, nil
}
func GetCommentByID(commentID uint) (*model.Comment, error) {
var comment model.Comment
if err := db.Preload("User").Preload("Resource").First(&comment, commentID).Error; err != nil {
return nil, err
}
return &comment, nil
}