mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
modified game response
This commit is contained in:
+2
-2
@@ -4,8 +4,8 @@ FROM golang:1.24-bullseye AS builder
|
|||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
ENV GOOS=linux
|
ENV GOOS=linux
|
||||||
# Changed from Apple Silicon arm64 config.
|
# Changed from Apple Silicon arm64 config.
|
||||||
ENV GOARCH=amd64
|
# ENV GOARCH=amd64
|
||||||
# ENV GOARCH=arm64
|
ENV GOARCH=arm64
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ type TeamGameAdvStatDTO struct {
|
|||||||
|
|
||||||
// GameResponseDTO is the top-level object for a single game in the response.
|
// GameResponseDTO is the top-level object for a single game in the response.
|
||||||
type GameResponseDTO struct {
|
type GameResponseDTO struct {
|
||||||
ID uint `json:"id"`
|
// ID uint `json:"id"`
|
||||||
GameID string `json:"gameId"`
|
GameID string `json:"gameId"`
|
||||||
Date time.Time `json:"date"`
|
Date time.Time `json:"date"`
|
||||||
IsPlayoff bool `json:"isPlayoff"`
|
IsPlayoff bool `json:"isPlayoff"`
|
||||||
@@ -128,7 +128,7 @@ type GameResponseDTO struct {
|
|||||||
HomeTeam string `json:"homeTeam"`
|
HomeTeam string `json:"homeTeam"`
|
||||||
HomePTS int `json:"homePts"`
|
HomePTS int `json:"homePts"`
|
||||||
GameDuration string `json:"gameDuration"`
|
GameDuration string `json:"gameDuration"`
|
||||||
BoxScoreURL string `json:"boxScoreUrl"`
|
// BoxScoreURL string `json:"boxScoreUrl"`
|
||||||
LineScores []LineScoreDTO `json:"lineScores,omitempty"`
|
LineScores []LineScoreDTO `json:"lineScores,omitempty"`
|
||||||
PlayerGameBasicStats []PlayerGameBasicStatDTO `json:"playerGameBasicStats,omitempty"`
|
PlayerGameBasicStats []PlayerGameBasicStatDTO `json:"playerGameBasicStats,omitempty"`
|
||||||
PlayerGameAdvStats []PlayerGameAdvStatDTO `json:"playerGameAdvStats,omitempty"`
|
PlayerGameAdvStats []PlayerGameAdvStatDTO `json:"playerGameAdvStats,omitempty"`
|
||||||
@@ -267,7 +267,7 @@ func GetGames(db *gorm.DB) fiber.Handler {
|
|||||||
// toGameResponseDTO converts a Game model to its corresponding DTO, including nested associations.
|
// toGameResponseDTO converts a Game model to its corresponding DTO, including nested associations.
|
||||||
func toGameResponseDTO(game models.Game) GameResponseDTO {
|
func toGameResponseDTO(game models.Game) GameResponseDTO {
|
||||||
dto := GameResponseDTO{
|
dto := GameResponseDTO{
|
||||||
ID: game.ID,
|
// ID: game.ID,
|
||||||
GameID: game.GameID,
|
GameID: game.GameID,
|
||||||
Date: game.Date,
|
Date: game.Date,
|
||||||
IsPlayoff: game.IsPlayoff,
|
IsPlayoff: game.IsPlayoff,
|
||||||
@@ -278,7 +278,7 @@ func toGameResponseDTO(game models.Game) GameResponseDTO {
|
|||||||
HomeTeam: utils.GetAbbreviation(game.HomeTeam),
|
HomeTeam: utils.GetAbbreviation(game.HomeTeam),
|
||||||
HomePTS: game.HomePTS,
|
HomePTS: game.HomePTS,
|
||||||
GameDuration: game.GameDuration,
|
GameDuration: game.GameDuration,
|
||||||
BoxScoreURL: game.BoxScoreURL,
|
// BoxScoreURL: game.BoxScoreURL,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform nested slices if they were loaded
|
// Transform nested slices if they were loaded
|
||||||
|
|||||||
@@ -117,18 +117,18 @@ func importPlayerShotCharts(db *gorm.DB) {
|
|||||||
// Nikola Jokić: "jokicni01"
|
// Nikola Jokić: "jokicni01"
|
||||||
// Luka Dončić: "doncilu01"
|
// Luka Dončić: "doncilu01"
|
||||||
targetPlayerIDs := []string{
|
targetPlayerIDs := []string{
|
||||||
"jamesle01",
|
// "jamesle01",
|
||||||
"curryst01",
|
// "curryst01",
|
||||||
"jokicni01",
|
// "jokicni01",
|
||||||
"doncilu01",
|
// "doncilu01",
|
||||||
"hardeja01",
|
// "hardeja01",
|
||||||
"irvinky01",
|
// "irvinky01",
|
||||||
"duranke01",
|
// "duranke01",
|
||||||
// "youngtr01",
|
// "youngtr01",
|
||||||
// "lillada01",
|
// "lillada01",
|
||||||
// "gilgesh01",
|
"gilgesh01",
|
||||||
// "brunsja01",
|
"brunsja01",
|
||||||
// "edwaran01",
|
"edwaran01",
|
||||||
// "mitchdo01",
|
// "mitchdo01",
|
||||||
// "bookede01",
|
// "bookede01",
|
||||||
// "derozde01",
|
// "derozde01",
|
||||||
|
|||||||
Reference in New Issue
Block a user