Implement comment length and IP rate limiting in comment creation

This commit is contained in:
2025-06-24 12:39:51 +08:00
parent 953b1cf86a
commit 3694e24aad
4 changed files with 85 additions and 33 deletions

View File

@@ -38,7 +38,7 @@ func createComment(c fiber.Ctx) error {
return model.NewRequestError("Content cannot be empty")
}
comment, err := service.CreateComment(req, userID, uint(resourceID))
comment, err := service.CreateComment(req, userID, uint(resourceID), c.IP())
if err != nil {
return err
}