feat(tester): add endpoints
add CreateSolution&GetSolution&ListSolutions endpoints
This commit is contained in:
parent
fb65ba8ce2
commit
6a83a9832d
1 changed files with 241 additions and 2 deletions
|
@ -183,7 +183,7 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
/contests/tasks:
|
/tasks:
|
||||||
post:
|
post:
|
||||||
operationId: AddTask
|
operationId: AddTask
|
||||||
security:
|
security:
|
||||||
|
@ -222,7 +222,7 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
/contests/participants:
|
/participants:
|
||||||
get:
|
get:
|
||||||
operationId: ListParticipants
|
operationId: ListParticipants
|
||||||
security:
|
security:
|
||||||
|
@ -311,6 +311,110 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
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:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
Problem:
|
Problem:
|
||||||
|
@ -684,6 +788,141 @@ components:
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
type: string
|
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:
|
securitySchemes:
|
||||||
bearerAuth:
|
bearerAuth:
|
||||||
type: http
|
type: http
|
||||||
|
|
Loading…
Add table
Reference in a new issue