mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 05:55:13 +00:00
swagger fix
This commit is contained in:
@@ -45,14 +45,14 @@ type AdvancedStatsResponse struct {
|
||||
// }
|
||||
|
||||
// ScrapePlayerAdvancedStats godoc
|
||||
// @ignore
|
||||
// @Summary Scrape player advanced stats from BR website
|
||||
// @Tags PlayerStats
|
||||
// @Param season query int true "Season (e.g. 2025)"
|
||||
// @Param isPlayoff query bool false "Whether playoffs?"
|
||||
// @Success 200 {object} map[string]string
|
||||
// @Failure 400,500 {object} map[string]string
|
||||
// @Router /api/playeradvancedstats/scrape [get]
|
||||
// @ignore
|
||||
// //@Router /api/playeradvancedstats/scrape [get]
|
||||
func ScrapePlayerAdvancedStats(db *gorm.DB) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
season := c.QueryInt("season", 0)
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
// }
|
||||
|
||||
// ScrapePlayerShotChart godoc
|
||||
// @ignore
|
||||
// @Summary Scrape a player's shot-chart from BR website
|
||||
// @Description Scrapes seasons [startSeason…endSeason] for the given playerId
|
||||
//
|
||||
@@ -43,8 +44,7 @@ import (
|
||||
// @Param endSeason query int true "End season (e.g. 2021)"
|
||||
// @Success 200 {object} map[string]string
|
||||
// @Failure 400,500 {object} map[string]string
|
||||
// @Router /api/playershotchart/scrape [get]
|
||||
// @ignore
|
||||
// //@Router /api/playershotchart/scrape [get]
|
||||
func ScrapePlayerShotChart(db *gorm.DB) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
pid := c.Query("playerId")
|
||||
|
||||
@@ -47,14 +47,14 @@ var totalSortMap = map[string]string{
|
||||
// }
|
||||
|
||||
// ScrapePlayerTotalStats godoc
|
||||
// @ignore
|
||||
// @Summary Scrape player total stats from BR website
|
||||
// @Tags PlayerTotals
|
||||
// @Param season query int true "Season (e.g. 2025)"
|
||||
// @Param isPlayoff query bool false "Whether playoffs?"
|
||||
// @Success 200 {object} map[string]string
|
||||
// @Failure 400,500 {object} map[string]string
|
||||
// @Router /api/playertotals/scrape [get]
|
||||
// @ignore
|
||||
// //@Router /api/playertotals/scrape [get]
|
||||
func ScrapePlayerTotalStats(db *gorm.DB) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
season := c.QueryInt("season", 0)
|
||||
|
||||
-171
@@ -101,58 +101,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playeradvancedstats/scrape": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"PlayerStats"
|
||||
],
|
||||
"summary": "Scrape player advanced stats from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Season (e.g. 2025)",
|
||||
"name": "season",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "Whether playoffs?",
|
||||
"name": "isPlayoff",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playershotchart": {
|
||||
"get": {
|
||||
"description": "Returns shot-chart points, optionally filtered by playerId and/or season",
|
||||
@@ -202,73 +150,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playershotchart/scrape": {
|
||||
"get": {
|
||||
"description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"PlayerShotChart"
|
||||
],
|
||||
"summary": "Scrape a player's shot-chart from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Player ID (e.g. derozde01)",
|
||||
"name": "playerId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Start season (e.g. 2024)",
|
||||
"name": "startSeason",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "End season (e.g. 2021)",
|
||||
"name": "endSeason",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals": {
|
||||
"get": {
|
||||
"description": "Filter and paginate player totals",
|
||||
@@ -353,58 +234,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals/scrape": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"PlayerTotals"
|
||||
],
|
||||
"summary": "Scrape player total stats from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Season (e.g. 2025)",
|
||||
"name": "season",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "Whether playoffs?",
|
||||
"name": "isPlayoff",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
||||
@@ -98,58 +98,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playeradvancedstats/scrape": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"PlayerStats"
|
||||
],
|
||||
"summary": "Scrape player advanced stats from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Season (e.g. 2025)",
|
||||
"name": "season",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "Whether playoffs?",
|
||||
"name": "isPlayoff",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playershotchart": {
|
||||
"get": {
|
||||
"description": "Returns shot-chart points, optionally filtered by playerId and/or season",
|
||||
@@ -199,73 +147,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playershotchart/scrape": {
|
||||
"get": {
|
||||
"description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"PlayerShotChart"
|
||||
],
|
||||
"summary": "Scrape a player's shot-chart from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Player ID (e.g. derozde01)",
|
||||
"name": "playerId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Start season (e.g. 2024)",
|
||||
"name": "startSeason",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "End season (e.g. 2021)",
|
||||
"name": "endSeason",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals": {
|
||||
"get": {
|
||||
"description": "Filter and paginate player totals",
|
||||
@@ -350,58 +231,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals/scrape": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"PlayerTotals"
|
||||
],
|
||||
"summary": "Scrape player total stats from BR website",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Season (e.g. 2025)",
|
||||
"name": "season",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "Whether playoffs?",
|
||||
"name": "isPlayoff",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
||||
@@ -185,40 +185,6 @@ paths:
|
||||
summary: Get player advanced stats
|
||||
tags:
|
||||
- PlayerStats
|
||||
/api/playeradvancedstats/scrape:
|
||||
get:
|
||||
parameters:
|
||||
- description: Season (e.g. 2025)
|
||||
in: query
|
||||
name: season
|
||||
required: true
|
||||
type: integer
|
||||
- description: Whether playoffs?
|
||||
in: query
|
||||
name: isPlayoff
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Scrape player advanced stats from BR website
|
||||
tags:
|
||||
- PlayerStats
|
||||
/api/playershotchart:
|
||||
get:
|
||||
consumes:
|
||||
@@ -252,51 +218,6 @@ paths:
|
||||
summary: Get shot-chart data
|
||||
tags:
|
||||
- PlayerShotChart
|
||||
/api/playershotchart/scrape:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Scrapes seasons [startSeason…endSeason] for the given playerId
|
||||
parameters:
|
||||
- description: Player ID (e.g. derozde01)
|
||||
in: query
|
||||
name: playerId
|
||||
required: true
|
||||
type: string
|
||||
- description: Start season (e.g. 2024)
|
||||
in: query
|
||||
name: startSeason
|
||||
required: true
|
||||
type: integer
|
||||
- description: End season (e.g. 2021)
|
||||
in: query
|
||||
name: endSeason
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Scrape a player's shot-chart from BR website
|
||||
tags:
|
||||
- PlayerShotChart
|
||||
/api/playertotals:
|
||||
get:
|
||||
consumes:
|
||||
@@ -354,40 +275,6 @@ paths:
|
||||
summary: Get player total stats
|
||||
tags:
|
||||
- PlayerTotals
|
||||
/api/playertotals/scrape:
|
||||
get:
|
||||
parameters:
|
||||
- description: Season (e.g. 2025)
|
||||
in: query
|
||||
name: season
|
||||
required: true
|
||||
type: integer
|
||||
- description: Whether playoffs?
|
||||
in: query
|
||||
name: isPlayoff
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Scrape player total stats from BR website
|
||||
tags:
|
||||
- PlayerTotals
|
||||
schemes:
|
||||
- http
|
||||
- https
|
||||
|
||||
Reference in New Issue
Block a user