chore: build
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services.GeoService) {
|
||||
func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services.GeoService, s3Service *services.S3Service) {
|
||||
|
||||
// ============================================
|
||||
// 🔐 MIDDLEWARE GLOBAL
|
||||
@@ -17,6 +17,7 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
router.Use(func(c *gin.Context) {
|
||||
c.Set("database", database)
|
||||
c.Set("geoService", geoService)
|
||||
c.Set("s3Service", s3Service)
|
||||
})
|
||||
|
||||
// ============================================
|
||||
@@ -88,6 +89,10 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
|
||||
// ⭐ NOUVEAU - HISTORIQUE DES COMMANDES TERMINÉES
|
||||
cartGroupV1.GET("/my-commands/history", handlers.GetClientCommandsHistory)
|
||||
// NOTATION LIVREUR
|
||||
cartGroupV1.POST("/orders/:id/rate", handlers.SubmitLivreurRating)
|
||||
cartGroupV1.GET("/orders/:id/rating", handlers.GetOrderRatingStatus)
|
||||
|
||||
// ⭐⭐ PÉNALITÉS CLIENT
|
||||
cartGroupV1.GET("/penalties", handlers.GetMyPenalties) // Voir mes pénalités
|
||||
|
||||
@@ -123,7 +128,12 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
// ============================================
|
||||
// 💸 WEBHOOK NOWPAYMENTS (v1) - PUBLIC (pas d'auth, vérifié par HMAC)
|
||||
// ============================================
|
||||
router.POST("/api/v1/webhook/nowpayments", handlers.IPNWebhook)
|
||||
router.POST("/api/v1/webhooks/nowpayments", handlers.IPNWebhook)
|
||||
|
||||
// ============================================
|
||||
// 🖼️ PROXY MÉDIAS (RustFS privé via VPN)
|
||||
// ============================================
|
||||
router.GET("/media/*key", handlers.ServeMedia)
|
||||
|
||||
// ============================================
|
||||
// 🤖 WEBHOOK TELEGRAM - PUBLIC (sécurisé par secret header)
|
||||
@@ -135,6 +145,11 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
// ============================================
|
||||
router.POST("/api/internal/telegram/link", handlers.InternalTelegramLink)
|
||||
|
||||
// ============================================
|
||||
// 📋 HEALTH CHECK
|
||||
// ============================================
|
||||
router.GET("/health", handlers.Health)
|
||||
|
||||
// ============================================
|
||||
// 📋 PATTERN v2: ADMIN API
|
||||
// ============================================
|
||||
@@ -197,16 +212,18 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
// CATÉGORIES - GESTION ADMIN
|
||||
// ============================================
|
||||
adminGroupV2.POST("/categories", handlers.CreateCategory)
|
||||
adminGroupV2.PUT("/categories/reorder", handlers.ReorderCategories)
|
||||
adminGroupV2.PUT("/categories/:id", handlers.UpdateCategory)
|
||||
adminGroupV2.DELETE("/categories/:id", handlers.DeleteCategory)
|
||||
// ============================================
|
||||
// STATISTIQUES ADMIN
|
||||
// ============================================
|
||||
adminGroupV2.GET("/stats", handlers.GetAdminStats)
|
||||
|
||||
adminGroupV2.POST("/stats/reset/:section", handlers.ResetAdminStats)
|
||||
adminGroupV2.GET("/stats/monthly", handlers.GetAdminStatsByMonth)
|
||||
adminGroupV2.POST("/active/product/price/:id", handlers.ActivePrice)
|
||||
adminGroupV2.POST("/desactive/product/price/:id", handlers.DesActivePrice)
|
||||
|
||||
adminGroupV2.GET("/stats/daily", handlers.GetAdminDailyDetail)
|
||||
// ============================================
|
||||
// COMMANDES - GESTION DE BASE
|
||||
// ============================================
|
||||
@@ -260,6 +277,8 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
adminGroupV2.PUT("/delivery-persons/update/:username/location", handlers.UpdateDeliveryPersonLocationAdmin)
|
||||
adminGroupV2.DELETE("/delivery-persons/:username/queue/:command_id", handlers.RemoveCommandFromQueue)
|
||||
adminGroupV2.GET("/delivery-persons/:username/map-links", handlers.GetDeliveryPersonMapLinks)
|
||||
adminGroupV2.GET("/delivery-persons/:username/ratings", handlers.GetLivreurRatings)
|
||||
adminGroupV2.GET("/delivery-persons/:username/login-history", handlers.GetLivreurLoginHistory)
|
||||
// Commandes annulées
|
||||
adminGroupV2.GET("/orders/cancelled", handlers.GetAllCancelledOrders)
|
||||
// ============================================
|
||||
@@ -392,6 +411,8 @@ func SetupRoutes(router *gin.Engine, database *db.Database, geoService *services
|
||||
// ============================================
|
||||
// NOTIFICATIONS LIVREUR
|
||||
// ============================================
|
||||
livreurGroupV1.GET("/ratings", handlers.GetMyRatings)
|
||||
|
||||
livreurGroupV1.GET("/notifications", handlers.GetLivreurNotifications)
|
||||
livreurGroupV1.POST("/notifications/read", handlers.MarkLivreurNotificationsRead)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user