populate both tables in loop

This commit is contained in:
Ravi Prasad
2025-04-30 22:49:38 -05:00
parent 80e4823b35
commit e3c8c76f35
15 changed files with 506 additions and 32 deletions
+14
View File
@@ -0,0 +1,14 @@
package routes
import (
"github.com/gofiber/fiber/v2"
"gorm.io/gorm"
"github.com/nprasad2077/NBA_Go/controllers"
)
func RegisterPlayerAdvancedRoutes(app *fiber.App, db *gorm.DB) {
api := app.Group("/api/playeradvancedstats")
api.Get("/fetch", controllers.FetchPlayerAdvancedStats(db))
api.Get("/", controllers.GetAllAdvancedPlayerStats(db)) // ✅ Add this line
}
-14
View File
@@ -1,14 +0,0 @@
package routes
import (
"github.com/gofiber/fiber/v2"
"gorm.io/gorm"
"github.com/nprasad2077/NBA_Go/controllers"
)
func RegisterPlayerRoutes(app *fiber.App, db *gorm.DB) {
api := app.Group("/api/playerstats")
api.Get("/fetch", controllers.FetchPlayerStats(db))
api.Get("/", controllers.GetAllPlayerStats(db)) // ✅ Add this line
}
+14
View File
@@ -0,0 +1,14 @@
package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/nprasad2077/NBA_Go/controllers"
"gorm.io/gorm"
)
func RegisterPlayerTotalRoutes(app *fiber.App, db *gorm.DB) {
api := app.Group("/api/playertotals")
api.Get("/fetch", controllers.FetchPlayerTotalStats(db))
api.Get("/", controllers.GetPlayerTotalStats(db))
}