refactor(tester): refactor api

This commit is contained in:
Vyacheslav1557 2025-03-29 00:33:55 +05:00
parent 9c69ced34b
commit 16781a4641

View file

@ -13,12 +13,14 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: pageSize
in: query
required: true
schema:
type: integer
format: int32
example: 10
security:
- bearerAuth: [ ]
responses:
@ -51,6 +53,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -69,6 +72,7 @@ paths:
schema:
type: integer
format: int32
example: 3
responses:
"200":
description: OK
@ -84,6 +88,7 @@ paths:
schema:
type: integer
format: int32
example: 3
requestBody:
required: true
content:
@ -104,12 +109,14 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: pageSize
in: query
required: true
schema:
type: integer
format: int32
example: 10
security:
- bearerAuth: [ ]
responses:
@ -142,6 +149,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -160,6 +168,7 @@ paths:
schema:
type: integer
format: int32
example: 3
responses:
"200":
description: OK
@ -174,6 +183,7 @@ paths:
schema:
type: integer
format: int32
example: 3
requestBody:
required: true
content:
@ -195,12 +205,14 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: problem_id
in: query
required: true
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -220,6 +232,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -238,6 +251,7 @@ paths:
schema:
type: integer
format: int32
example: 3
responses:
"200":
description: OK
@ -253,18 +267,21 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: page
in: query
required: true
schema:
type: integer
format: int32
example: 1
- name: pageSize
in: query
required: true
schema:
type: integer
format: int32
example: 10
responses:
"200":
description: OK
@ -283,12 +300,14 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: user_id
in: query
required: true
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -307,6 +326,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -321,6 +341,7 @@ paths:
schema:
type: integer
format: int32
example: 1
requestBody:
required: true
content:
@ -342,12 +363,14 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: language
in: query
required: true
schema:
type: integer
format: int32
example: 1
requestBody:
required: true
content:
@ -372,42 +395,50 @@ paths:
schema:
type: integer
format: int32
example: 1
- name: pageSize
in: query
required: true
schema:
type: integer
format: int32
example: 10
- name: contest_id
in: query
schema:
type: integer
format: int32
example: 1
- name: participantId
in: query
schema:
type: integer
format: int32
example: 1
- name: task_id
in: query
schema:
type: integer
format: int32
example: 1
- name: state
in: query
schema:
type: integer
format: int32
example: 1
- name: order
in: query
schema:
type: integer
format: int32
example: 1
- name: language
in: query
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -427,6 +458,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -446,6 +478,7 @@ paths:
schema:
type: integer
format: int32
example: 1
responses:
"200":
description: OK
@ -455,6 +488,20 @@ paths:
$ref: '#/components/schemas/GetMonitorResponse'
components:
schemas:
Pagination:
type: object
required:
- page
- total
properties:
page:
type: integer
format: int32
example: 1
total:
type: integer
format: int32
example: 10
Problem:
type: object
required:
@ -481,14 +528,18 @@ components:
id:
type: integer
format: int32
example: 1
title:
type: string
example: "Test problem"
time_limit:
type: integer
format: int32
example: 1000
memory_limit:
type: integer
format: int32
example: 256
legend:
type: string
@ -518,7 +569,7 @@ components:
updated_at:
type: string
format: date-time
ProblemListItem:
ProblemsListItem:
type: object
required:
- id
@ -549,19 +600,14 @@ components:
type: object
required:
- problems
- page
- max_page
- pagination
properties:
problems:
type: array
items:
$ref: '#/components/schemas/ProblemListItem'
page:
type: integer
format: int32
max_page:
type: integer
format: int32
$ref: '#/components/schemas/ProblemsListItem'
pagination:
$ref: '#/components/schemas/Pagination'
CreateProblemResponse:
type: object
required:
@ -570,6 +616,7 @@ components:
id:
type: integer
format: int32
example: 1
GetProblemResponse:
type: object
required:
@ -588,8 +635,10 @@ components:
id:
type: integer
format: int32
example: 1
title:
type: string
example: "Test contest"
created_at:
type: string
format: date-time
@ -607,8 +656,10 @@ components:
id:
type: integer
format: int32
example: 1
title:
type: string
example: "Test contest"
created_at:
type: string
format: date-time
@ -619,19 +670,14 @@ components:
type: object
required:
- contests
- page
- max_page
- pagination
properties:
contests:
type: array
items:
$ref: '#/components/schemas/ContestsListItem'
page:
type: integer
format: int32
max_page:
type: integer
format: int32
pagination:
$ref: '#/components/schemas/Pagination'
CreateContestResponse:
type: object
required:
@ -640,6 +686,7 @@ components:
id:
type: integer
format: int32
example: 1
TasksListItem:
type: object
required:
@ -655,20 +702,26 @@ components:
id:
type: integer
format: int32
example: 1
problem_id:
type: integer
format: int32
example: 1
position:
type: integer
format: int32
example: 1
title:
type: string
example: "Test task"
memory_limit:
type: integer
format: int32
example: 256
time_limit:
type: integer
format: int32
example: 1000
created_at:
type: string
format: date-time
@ -703,6 +756,7 @@ components:
id:
type: integer
format: int32
example: 1
AddTaskResponse:
type: object
required:
@ -711,6 +765,7 @@ components:
id:
type: integer
format: int32
example: 1
ParticipantsListItem:
type: object
required:
@ -723,11 +778,14 @@ components:
id:
type: integer
format: int32
example: 1
name:
type: string
example: "Test user"
user_id:
type: integer
format: int32
example: 1
created_at:
type: string
format: date-time
@ -738,24 +796,20 @@ components:
type: object
required:
- participants
- page
- max_page
- pagination
properties:
participants:
type: array
items:
$ref: '#/components/schemas/ParticipantsListItem'
page:
type: integer
format: int32
max_page:
type: integer
format: int32
pagination:
$ref: '#/components/schemas/Pagination'
UpdateProblemRequest:
type: object
properties:
title:
type: string
example: "Test problem"
legend:
type: string
input_format:
@ -769,19 +823,23 @@ components:
memory_limit:
type: integer
format: int32
example: 256
time_limit:
type: integer
format: int32
example: 1000
UpdateContestRequest:
type: object
properties:
title:
type: string
example: "Test contest"
UpdateParticipantRequest:
type: object
properties:
name:
type: string
example: "Test user"
CreateSolutionRequest:
type: object
required:
@ -790,6 +848,7 @@ components:
solution:
type: string
format: binary
example: 'print("Hello, world!")'
CreateSolutionResponse:
type: object
required:
@ -798,23 +857,19 @@ components:
id:
type: integer
format: int32
example: 1
ListSolutionsResponse:
type: object
required:
- solutions
- page
- max_page
- pagination
properties:
solutions:
type: array
items:
$ref: '#/components/schemas/SolutionsListItem'
page:
type: integer
format: int32
max_page:
type: integer
format: int32
pagination:
$ref: '#/components/schemas/Pagination'
SolutionsListItem:
type: object
required:
@ -833,30 +888,39 @@ components:
id:
type: integer
format: int32
example: 1
task_id:
type: integer
format: int32
example: 1
contest_id:
type: integer
format: int32
example: 1
participant_id:
type: integer
format: int32
example: 1
state:
type: integer
format: int32
example: 1
score:
type: integer
format: int32
example: 100
penalty:
type: integer
format: int32
example: 28
total_score:
type: integer
format: int32
example: 100
language:
type: integer
format: int32
example: 1
updated_at:
type: string
format: date-time
@ -881,29 +945,38 @@ components:
id:
type: integer
format: int32
example: 1
task_id:
type: integer
format: int32
example: 1
participant_id:
type: integer
format: int32
example: 1
state:
type: integer
format: int32
example: 1
score:
type: integer
format: int32
example: 100
penalty:
type: integer
format: int32
example: 28
total_score:
type: integer
format: int32
example: 100
language:
type: integer
format: int32
example: 1
solution:
type: string
example: 'print("Hello, world!")'
updated_at:
type: string
format: date-time
@ -938,17 +1011,22 @@ components:
id:
type: integer
format: int32
example: 1
position:
type: integer
format: int32
example: 1
title:
type: string
example: "Test task"
time_limit:
type: integer
format: int32
example: 1000
memory_limit:
type: integer
format: int32
example: 256
legend_html:
type: string
@ -972,92 +1050,85 @@ components:
required:
- task
- contest
- tasks
properties:
contest:
type: object
required:
- id
- title
- tasks
properties:
id:
type: integer
format: int32
title:
type: string
tasks:
type: array
items:
$ref: '#/components/schemas/TasksListItem'
$ref: '#/components/schemas/Contest'
tasks:
type: array
items:
$ref: '#/components/schemas/TasksListItem'
task:
$ref: '#/components/schemas/Task'
GetMonitorResponse:
type: object
required:
- contest
- tasks
- participants
- summary_per_problem
properties:
contest:
type: object
required:
- id
- title
- tasks
properties:
id:
type: integer
format: int32
title:
type: string
tasks:
type: array
items:
$ref: '#/components/schemas/TasksListItem'
$ref: '#/components/schemas/Contest'
tasks:
type: array
items:
$ref: '#/components/schemas/TasksListItem'
participants:
type: array
items:
type: object
required:
- id
- name
- solved_in_total
- penalty_in_total
- solutions
properties:
id:
type: integer
format: int32
name:
type: string
solved_in_total:
type: integer
format: int32
penalty_in_total:
type: integer
format: int32
solutions:
type: array
items:
$ref: '#/components/schemas/SolutionsListItem'
$ref: '#/components/schemas/ParticipantsStat'
summary_per_problem:
type: array
items:
type: object
required:
- id
- success
- total
properties:
id:
type: integer
format: int32
success:
type: integer
format: int32
total:
type: integer
format: int32
$ref: '#/components/schemas/ProblemStatSummary'
ProblemStatSummary:
type: object
required:
- id
- success
- total
properties:
id:
type: integer
format: int32
example: 1
success:
type: integer
format: int32
example: 14
total:
type: integer
format: int32
example: 20
ParticipantsStat:
type: object
required:
- id
- name
- solved_in_total
- penalty_in_total
- solutions
properties:
id:
type: integer
format: int32
example: 1
name:
type: string
example: "John Doe"
solved_in_total:
type: integer
format: int32
example: 3
penalty_in_total:
type: integer
format: int32
example: 144
solutions:
type: array
items:
$ref: '#/components/schemas/SolutionsListItem'
securitySchemes:
bearerAuth:
type: http