feat(tester): add endpoints

add CreateSolution&GetSolution&ListSolutions endpoints
This commit is contained in:
Vyacheslav1557 2025-03-26 23:57:25 +05:00
parent fb65ba8ce2
commit 6a83a9832d

View file

@ -183,7 +183,7 @@ paths:
responses:
"200":
description: OK
/contests/tasks:
/tasks:
post:
operationId: AddTask
security:
@ -222,7 +222,7 @@ paths:
responses:
"200":
description: OK
/contests/participants:
/participants:
get:
operationId: ListParticipants
security:
@ -311,6 +311,110 @@ paths:
responses:
"200":
description: OK
/solutions:
post:
operationId: CreateSolution
security:
- bearerAuth: [ ]
parameters:
- name: task_id
in: query
required: true
schema:
type: integer
format: int32
- name: language
in: query
required: true
schema:
type: integer
format: int32
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/CreateSolutionRequest'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSolutionResponse'
get:
operationId: ListSolutions
security:
- bearerAuth: [ ]
parameters:
- name: page
in: query
required: true
schema:
type: integer
format: int32
- name: pageSize
in: query
required: true
schema:
type: integer
format: int32
- name: contest_id
in: query
schema:
type: integer
format: int32
- name: participantId
in: query
schema:
type: integer
format: int32
- name: task_id
in: query
schema:
type: integer
format: int32
- name: state
in: query
schema:
type: integer
format: int32
- name: order
in: query
schema:
type: integer
format: int32
- name: language
in: query
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListSolutionsResponse'
/solutions/{id}:
get:
operationId: GetSolution
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetSolutionResponse'
components:
schemas:
Problem:
@ -684,6 +788,141 @@ components:
properties:
name:
type: string
CreateSolutionRequest:
type: object
required:
- solution
properties:
solution:
type: string
format: binary
CreateSolutionResponse:
type: object
required:
- id
properties:
id:
type: integer
format: int32
ListSolutionsResponse:
type: object
required:
- solutions
- page
- max_page
properties:
solutions:
type: array
items:
$ref: '#/components/schemas/SolutionListItem'
page:
type: integer
format: int32
max_page:
type: integer
format: int32
SolutionListItem:
type: object
required:
- id
- task_id
- contest_id
- participant_id
- state
- score
- penalty
- total_score
- language
- updated_at
- created_at
properties:
id:
type: integer
format: int32
task_id:
type: integer
format: int32
contest_id:
type: integer
format: int32
participant_id:
type: integer
format: int32
state:
type: integer
format: int32
score:
type: integer
format: int32
penalty:
type: integer
format: int32
total_score:
type: integer
format: int32
language:
type: integer
format: int32
updated_at:
type: string
format: date-time
created_at:
type: string
format: date-time
Solution:
type: object
required:
- id
- task_id
- participant_id
- state
- score
- penalty
- total_score
- solution
- language
- updated_at
- created_at
properties:
id:
type: integer
format: int32
task_id:
type: integer
format: int32
participant_id:
type: integer
format: int32
state:
type: integer
format: int32
score:
type: integer
format: int32
penalty:
type: integer
format: int32
total_score:
type: integer
format: int32
language:
type: integer
format: int32
solution:
type: string
updated_at:
type: string
format: date-time
created_at:
type: string
format: date-time
GetSolutionResponse:
type: object
required:
- solution
properties:
solution:
$ref: '#/components/schemas/Solution'
securitySchemes:
bearerAuth:
type: http