mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
514 lines
16 KiB
Go
514 lines
16 KiB
Go
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/api/playeradvancedstats": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns filtered and paginated player advanced stats",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"PlayerStats"
|
|
],
|
|
"summary": "Get player advanced stats",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Season (e.g., 2025)",
|
|
"name": "season",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Team abbreviation (e.g., MIL)",
|
|
"name": "team",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Player ID (e.g., greenaj01)",
|
|
"name": "playerId",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 1,
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Page size",
|
|
"name": "pageSize",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"default": "winShares",
|
|
"description": "Field to sort by",
|
|
"name": "sortBy",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Sort ascending",
|
|
"name": "ascending",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Whether playoffs?",
|
|
"name": "isPlayoff",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/controllers.AdvancedStatsResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/playershotchart": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Returns shot-chart points, optionally filtered by playerId and/or season",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"PlayerShotChart"
|
|
],
|
|
"summary": "Get shot-chart data",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Player ID (e.g., hardeja01)",
|
|
"name": "playerId",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Season (e.g., 2023)",
|
|
"name": "season",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.PlayerShotChart"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/playershotchart/fetch": {
|
|
"get": {
|
|
"description": "Imports shot-chart data for the given playerId and stores/updates in DB",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"PlayerShotChart"
|
|
],
|
|
"summary": "Fetch a single player's shot-chart data from external API",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Player ID (e.g., hardeja01)",
|
|
"name": "playerId",
|
|
"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": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Filter and paginate player totals",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"PlayerTotals"
|
|
],
|
|
"summary": "Get player total stats",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Season (e.g. 2000)",
|
|
"name": "season",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Team abbreviation (e.g. LAL)",
|
|
"name": "team",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Player ID (e.g. greenac01)",
|
|
"name": "playerId",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 1,
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"default": 20,
|
|
"description": "Page size",
|
|
"name": "pageSize",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Field to sort by (e.g. points, assists)",
|
|
"name": "sortBy",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Sort ascending (default false)",
|
|
"name": "ascending",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"description": "Whether the stats are for playoffs",
|
|
"name": "isPlayoff",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"controllers.AdvancedStatsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.PlayerAdvancedStat"
|
|
}
|
|
},
|
|
"pagination": {
|
|
"type": "object",
|
|
"properties": {
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"pageSize": {
|
|
"type": "integer"
|
|
},
|
|
"pages": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"models.PlayerAdvancedStat": {
|
|
"type": "object",
|
|
"properties": {
|
|
"age": {
|
|
"type": "integer"
|
|
},
|
|
"assistPercent": {
|
|
"type": "number"
|
|
},
|
|
"blockPercent": {
|
|
"type": "number"
|
|
},
|
|
"box": {
|
|
"type": "number"
|
|
},
|
|
"defensiveBox": {
|
|
"type": "number"
|
|
},
|
|
"defensiveRBPercent": {
|
|
"type": "number"
|
|
},
|
|
"defensiveWS": {
|
|
"type": "number"
|
|
},
|
|
"ftr": {
|
|
"type": "number"
|
|
},
|
|
"games": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"isPlayoff": {
|
|
"type": "boolean"
|
|
},
|
|
"minutesPlayed": {
|
|
"type": "integer"
|
|
},
|
|
"offensiveBox": {
|
|
"type": "number"
|
|
},
|
|
"offensiveRBPercent": {
|
|
"type": "number"
|
|
},
|
|
"offensiveWS": {
|
|
"type": "number"
|
|
},
|
|
"per": {
|
|
"type": "number"
|
|
},
|
|
"playerId": {
|
|
"type": "string"
|
|
},
|
|
"playerName": {
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"type": "string"
|
|
},
|
|
"season": {
|
|
"type": "integer"
|
|
},
|
|
"stealPercent": {
|
|
"type": "number"
|
|
},
|
|
"team": {
|
|
"type": "string"
|
|
},
|
|
"threePAR": {
|
|
"type": "number"
|
|
},
|
|
"totalRBPercent": {
|
|
"type": "number"
|
|
},
|
|
"tsPercent": {
|
|
"type": "number"
|
|
},
|
|
"turnoverPercent": {
|
|
"type": "number"
|
|
},
|
|
"usagePercent": {
|
|
"type": "number"
|
|
},
|
|
"vorp": {
|
|
"type": "number"
|
|
},
|
|
"winShares": {
|
|
"type": "number"
|
|
},
|
|
"winSharesPer": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"models.PlayerShotChart": {
|
|
"type": "object",
|
|
"properties": {
|
|
"date": {
|
|
"type": "string"
|
|
},
|
|
"distanceFt": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"lead": {
|
|
"type": "boolean"
|
|
},
|
|
"left": {
|
|
"type": "integer"
|
|
},
|
|
"opponent": {
|
|
"type": "string"
|
|
},
|
|
"opponentTeamScore": {
|
|
"type": "integer"
|
|
},
|
|
"playerId": {
|
|
"type": "string"
|
|
},
|
|
"playerName": {
|
|
"type": "string"
|
|
},
|
|
"qtr": {
|
|
"type": "string"
|
|
},
|
|
"result": {
|
|
"type": "boolean"
|
|
},
|
|
"season": {
|
|
"type": "integer"
|
|
},
|
|
"shotType": {
|
|
"type": "string"
|
|
},
|
|
"team": {
|
|
"type": "string"
|
|
},
|
|
"teamScore": {
|
|
"type": "integer"
|
|
},
|
|
"timeRemaining": {
|
|
"type": "string"
|
|
},
|
|
"top": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "X-API-Key",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "",
|
|
BasePath: "/",
|
|
Schemes: []string{"http", "https"},
|
|
Title: "NBA_Go API",
|
|
Description: "Stats service with API-key auth",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|