Added tracking for uploading and downloading files
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user