mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
swagger docs
This commit is contained in:
@@ -15,29 +15,31 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
app := fiber.New()
|
app := fiber.New()
|
||||||
|
|
||||||
|
app.Use(logger.New())
|
||||||
|
|
||||||
db := config.InitDB()
|
db := config.InitDB()
|
||||||
|
|
||||||
// Automatically fetch player stats on startup
|
// Automatically fetch player stats on startup
|
||||||
go func() {
|
go func() {
|
||||||
for season := 2020; season <= 2025; season++ {
|
for season := 1993; season <= 2025; season++ {
|
||||||
if err := services.FetchAndStorePlayerAdvancedStats(db, season); err != nil {
|
if err := services.FetchAndStorePlayerAdvancedStats(db, season); err != nil {
|
||||||
log.Printf("Fetch failed for player advanced season %d: %v\n", season, err)
|
log.Printf("Fetch failed for player advanced season %d: %v\n", season, err)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Fetch successful for player advanced season %d\n", season)
|
log.Printf("Fetch successful for player advanced season %d\n", season)
|
||||||
}
|
}
|
||||||
time.Sleep(2 * time.Second) // optional delay
|
time.Sleep(1100 * time.Millisecond) // optional delay
|
||||||
}
|
}
|
||||||
log.Printf("player advanced Import Success")
|
log.Printf("player advanced Import Success")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for season := 2020; season <= 2025; season++ {
|
for season := 1993; season <= 2025; season++ {
|
||||||
if err := services.FetchAndStorePlayerTotalStats(db, season); err != nil {
|
if err := services.FetchAndStorePlayerTotalStats(db, season); err != nil {
|
||||||
log.Printf("Fetch failed for player totals season %d: %v\n", season, err)
|
log.Printf("Fetch failed for player totals season %d: %v\n", season, err)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Fetch successful for player totals season %d\n", season)
|
log.Printf("Fetch successful for player totals season %d\n", season)
|
||||||
}
|
}
|
||||||
time.Sleep(1 * time.Second) // optional delay
|
time.Sleep(1000 * time.Millisecond) // optional delay
|
||||||
}
|
}
|
||||||
log.Printf("player totals Import Success")
|
log.Printf("player totals Import Success")
|
||||||
}()
|
}()
|
||||||
@@ -51,7 +53,5 @@ func main() {
|
|||||||
|
|
||||||
app.Get("/swagger/*", fiberswagger.WrapHandler)
|
app.Get("/swagger/*", fiberswagger.WrapHandler)
|
||||||
|
|
||||||
app.Use(logger.New())
|
|
||||||
|
|
||||||
app.Listen(":3001")
|
app.Listen(":3001")
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user