Refactor API structure and enhance logging/debugging.
Modularized OpenAPI definitions by splitting into dedicated files for teams, bans, and errors. Improved backend logging for database connections, CORS configuration, and debugging. Updated application properties to support environment-specific CORS origins and logging levels.
This commit is contained in:
@@ -10,96 +10,7 @@ tags:
|
||||
- name: player
|
||||
description: Retrieve player information
|
||||
paths:
|
||||
/player/teamMembers/{group}:
|
||||
get:
|
||||
tags:
|
||||
- team
|
||||
summary: Get team members
|
||||
description: Retrieve players who are part of the specified team
|
||||
operationId: getTeamMembers
|
||||
parameters:
|
||||
- name: group
|
||||
in: path
|
||||
required: true
|
||||
description: The group name of the team
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TeamMembers'
|
||||
default:
|
||||
description: Unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
/player/history:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Get player history
|
||||
description: Retrieves all types of player history about the player
|
||||
operationId: getPlayerHistory
|
||||
requestBody:
|
||||
description: The player history
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Player'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PlayerHistory'
|
||||
default:
|
||||
description: Unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
components:
|
||||
schemas:
|
||||
PlayerHistory:
|
||||
type: object
|
||||
properties:
|
||||
punishmentType:
|
||||
type: string
|
||||
punishment:
|
||||
type: string
|
||||
active:
|
||||
type: boolean
|
||||
start:
|
||||
type: integer
|
||||
format: int64
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
TeamMembers:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Player'
|
||||
Player:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: The name of the player
|
||||
example: a_name
|
||||
uuid:
|
||||
type: string
|
||||
example: 0c35e520-927e-4c6a-87ad-ff0739c22e9d
|
||||
description: The uuid of the team player
|
||||
required:
|
||||
- name
|
||||
- uuid
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
reason:
|
||||
type: string
|
||||
/team:
|
||||
$ref: './sub_api/team/team.yml'
|
||||
/history:
|
||||
$ref: './sub_api/bans/bans.yml'
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
paths:
|
||||
/history:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Get player history
|
||||
description: Retrieves all types of player history about the player
|
||||
operationId: getPlayerHistory
|
||||
requestBody:
|
||||
description: The player history
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Player'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PlayerHistory'
|
||||
default:
|
||||
description: Unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../generic/errors.yml#/components/schemas/Error"
|
||||
components:
|
||||
schemas:
|
||||
PlayerHistory:
|
||||
type: object
|
||||
properties:
|
||||
punishmentType:
|
||||
type: string
|
||||
punishment:
|
||||
type: string
|
||||
active:
|
||||
type: boolean
|
||||
start:
|
||||
type: integer
|
||||
format: int64
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
Player:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: The name of the player
|
||||
example: a_name
|
||||
uuid:
|
||||
type: string
|
||||
example: 0c35e520-927e-4c6a-87ad-ff0739c22e9d
|
||||
description: The uuid of the team player
|
||||
required:
|
||||
- name
|
||||
- uuid
|
||||
@@ -0,0 +1,7 @@
|
||||
components:
|
||||
schemas:
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
reason:
|
||||
type: string
|
||||
@@ -0,0 +1,48 @@
|
||||
paths:
|
||||
/{group}:
|
||||
get:
|
||||
tags:
|
||||
- team
|
||||
summary: Get team members
|
||||
description: Retrieve players who are part of the specified team
|
||||
operationId: getTeamMembers
|
||||
parameters:
|
||||
- name: group
|
||||
in: path
|
||||
required: true
|
||||
description: The group name of the team
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TeamMembers'
|
||||
default:
|
||||
description: Unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../generic/errors.yml#/components/schemas/Error"
|
||||
components:
|
||||
schemas:
|
||||
TeamMembers:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Player'
|
||||
Player:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: The name of the player
|
||||
example: a_name
|
||||
uuid:
|
||||
type: string
|
||||
example: 0c35e520-927e-4c6a-87ad-ff0739c22e9d
|
||||
description: The uuid of the team player
|
||||
required:
|
||||
- name
|
||||
- uuid
|
||||
Reference in New Issue
Block a user