mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 05:55:13 +00:00
populate both tables in loop
This commit is contained in:
+80
-1
@@ -15,7 +15,7 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/api/playerstats": {
|
||||
"/api/playeradvancedstats": {
|
||||
"get": {
|
||||
"description": "Returns filtered and paginated player stats",
|
||||
"consumes": [
|
||||
@@ -84,6 +84,85 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals": {
|
||||
"get": {
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
+80
-1
@@ -4,7 +4,7 @@
|
||||
"contact": {}
|
||||
},
|
||||
"paths": {
|
||||
"/api/playerstats": {
|
||||
"/api/playeradvancedstats": {
|
||||
"get": {
|
||||
"description": "Returns filtered and paginated player stats",
|
||||
"consumes": [
|
||||
@@ -73,6 +73,85 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/playertotals": {
|
||||
"get": {
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+54
-1
@@ -1,7 +1,7 @@
|
||||
info:
|
||||
contact: {}
|
||||
paths:
|
||||
/api/playerstats:
|
||||
/api/playeradvancedstats:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -48,4 +48,57 @@ paths:
|
||||
summary: Get player stats
|
||||
tags:
|
||||
- PlayerStats
|
||||
/api/playertotals:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Filter and paginate player totals
|
||||
parameters:
|
||||
- description: Season (e.g. 2000)
|
||||
in: query
|
||||
name: season
|
||||
type: integer
|
||||
- description: Team abbreviation (e.g. LAL)
|
||||
in: query
|
||||
name: team
|
||||
type: string
|
||||
- description: Player ID (e.g. greenac01)
|
||||
in: query
|
||||
name: playerId
|
||||
type: string
|
||||
- default: 1
|
||||
description: Page number
|
||||
in: query
|
||||
name: page
|
||||
type: integer
|
||||
- default: 20
|
||||
description: Page size
|
||||
in: query
|
||||
name: pageSize
|
||||
type: integer
|
||||
- description: Field to sort by (e.g. points, assists)
|
||||
in: query
|
||||
name: sortBy
|
||||
type: string
|
||||
- description: Sort ascending (default false)
|
||||
in: query
|
||||
name: ascending
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Get player total stats
|
||||
tags:
|
||||
- PlayerTotals
|
||||
swagger: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user