Added tracking for uploading and downloading files

This commit is contained in:
2025-08-17 00:47:10 +02:00
parent 91fb6c62aa
commit 496f9140a1
8 changed files with 65 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import (
"strconv"
"github.com/gin-gonic/gin"
"fitra-backend/utils"
)
func generateID() (string, error) {
@@ -99,6 +100,9 @@ func HandleFileUpload(c *gin.Context) {
baseURL = "http://localhost:8080"
}
// Send analytics event
utils.SendAnalyticsEvent("file_upload", "/api/upload", "File Upload", c.GetHeader("User-Agent"), c.ClientIP())
c.JSON(http.StatusOK, gin.H{
"message": "File uploaded successfully",
"id": fileID,