2024-05-05 19:42:33 +03:00
|
|
|
components:
|
|
|
|
responses:
|
|
|
|
errorResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
2023-11-01 23:21:12 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
properties:
|
|
|
|
code:
|
|
|
|
type: integer
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- code
|
|
|
|
- message
|
|
|
|
type: object
|
|
|
|
description: ""
|
|
|
|
filesListResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
2023-11-12 23:22:58 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/fileItem'
|
|
|
|
type: array
|
|
|
|
description: ""
|
|
|
|
gameAdminResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
2024-01-20 21:37:49 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
$ref: '#/components/schemas/gameEdit'
|
|
|
|
description: ""
|
|
|
|
gameListResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/gameView'
|
|
|
|
type: array
|
|
|
|
description: ""
|
|
|
|
gameResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/gameView'
|
|
|
|
description: ""
|
|
|
|
taskResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/taskView'
|
|
|
|
description: ""
|
|
|
|
uploadResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
2024-04-29 23:01:24 +03:00
|
|
|
schema:
|
2024-01-28 22:19:41 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
uuid:
|
|
|
|
format: uuid
|
2024-01-28 22:19:41 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
required:
|
|
|
|
- uuid
|
|
|
|
type: object
|
|
|
|
description: ""
|
|
|
|
userResponse:
|
|
|
|
content:
|
|
|
|
application/json:
|
2024-01-25 01:45:09 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
$ref: '#/components/schemas/userView'
|
|
|
|
description: ""
|
2023-11-01 23:21:12 +03:00
|
|
|
schemas:
|
2024-05-05 19:42:33 +03:00
|
|
|
codeEdit:
|
2023-11-01 23:21:12 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
code:
|
|
|
|
type: string
|
|
|
|
description:
|
|
|
|
type: string
|
2023-11-01 23:21:12 +03:00
|
|
|
id:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
2024-01-06 08:44:26 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
required:
|
|
|
|
- code
|
|
|
|
type: object
|
|
|
|
codeView:
|
|
|
|
properties:
|
|
|
|
code:
|
|
|
|
type: string
|
|
|
|
description:
|
|
|
|
type: string
|
|
|
|
type: object
|
|
|
|
fileItem:
|
|
|
|
properties:
|
|
|
|
id:
|
2024-01-06 08:44:26 +03:00
|
|
|
format: uuid
|
2023-11-01 23:21:12 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
originalName:
|
2024-01-21 02:20:59 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
size:
|
2024-01-21 02:20:59 +03:00
|
|
|
type: integer
|
|
|
|
required:
|
|
|
|
- id
|
2024-05-05 19:42:33 +03:00
|
|
|
- originalName
|
|
|
|
- size
|
2023-11-01 23:21:12 +03:00
|
|
|
type: object
|
2024-05-05 19:42:33 +03:00
|
|
|
gameEdit:
|
2023-11-01 23:21:12 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
description:
|
2024-01-06 08:44:26 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
icon:
|
2024-01-06 08:44:26 +03:00
|
|
|
format: uuid
|
2024-01-05 03:50:33 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
id:
|
|
|
|
format: uuid
|
2023-11-01 23:21:12 +03:00
|
|
|
type: string
|
2024-01-06 08:44:26 +03:00
|
|
|
points:
|
|
|
|
type: integer
|
2024-05-05 19:42:33 +03:00
|
|
|
tasks:
|
2024-01-06 08:44:26 +03:00
|
|
|
items:
|
2024-05-05 19:42:33 +03:00
|
|
|
$ref: '#/components/schemas/taskEdit'
|
|
|
|
type: array
|
|
|
|
title:
|
2024-01-20 21:37:49 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
type:
|
|
|
|
$ref: '#/components/schemas/gameType'
|
|
|
|
visible:
|
|
|
|
type: boolean
|
2024-01-05 03:50:33 +03:00
|
|
|
required:
|
2024-05-05 19:42:33 +03:00
|
|
|
- visible
|
2024-01-05 03:50:33 +03:00
|
|
|
- title
|
|
|
|
- description
|
|
|
|
- type
|
2024-05-05 19:42:33 +03:00
|
|
|
- tasks
|
2024-01-06 08:44:26 +03:00
|
|
|
- points
|
2023-11-01 23:21:12 +03:00
|
|
|
type: object
|
2024-05-05 19:42:33 +03:00
|
|
|
gameType:
|
|
|
|
enum:
|
|
|
|
- virtual
|
|
|
|
- city
|
|
|
|
type: string
|
|
|
|
gameView:
|
2023-11-01 23:21:12 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
authors:
|
2024-01-25 01:45:09 +03:00
|
|
|
items:
|
2024-05-05 19:42:33 +03:00
|
|
|
$ref: '#/components/schemas/userView'
|
|
|
|
type: array
|
|
|
|
createdAt:
|
|
|
|
type: string
|
2024-01-05 03:50:33 +03:00
|
|
|
description:
|
2023-11-01 23:21:12 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
icon:
|
|
|
|
format: uuid
|
2024-01-05 03:50:33 +03:00
|
|
|
type: string
|
2024-01-25 01:45:09 +03:00
|
|
|
id:
|
|
|
|
format: uuid
|
2023-11-02 01:21:13 +03:00
|
|
|
type: string
|
2024-01-05 03:50:33 +03:00
|
|
|
points:
|
|
|
|
type: integer
|
2024-05-05 19:42:33 +03:00
|
|
|
taskCount:
|
|
|
|
type: integer
|
|
|
|
title:
|
2024-01-20 21:37:49 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
type:
|
|
|
|
$ref: '#/components/schemas/gameType'
|
|
|
|
visible:
|
|
|
|
type: boolean
|
2023-11-02 01:21:13 +03:00
|
|
|
required:
|
2024-05-05 19:42:33 +03:00
|
|
|
- id
|
2023-11-02 01:21:13 +03:00
|
|
|
- title
|
|
|
|
- description
|
2024-01-05 03:50:33 +03:00
|
|
|
- type
|
|
|
|
- points
|
2024-05-05 19:42:33 +03:00
|
|
|
- taskCount
|
|
|
|
- createdAt
|
|
|
|
- authors
|
2023-11-19 22:54:54 +03:00
|
|
|
type: object
|
2024-05-05 19:42:33 +03:00
|
|
|
taskEdit:
|
2023-11-19 22:54:54 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
codes:
|
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/codeEdit'
|
|
|
|
type: array
|
2024-01-25 01:45:09 +03:00
|
|
|
id:
|
|
|
|
format: uuid
|
2023-11-19 22:54:54 +03:00
|
|
|
type: string
|
2024-01-05 03:50:33 +03:00
|
|
|
text:
|
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
title:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- id
|
|
|
|
- title
|
|
|
|
- text
|
|
|
|
- codes
|
|
|
|
type: object
|
|
|
|
taskView:
|
|
|
|
properties:
|
2024-01-05 03:50:33 +03:00
|
|
|
codes:
|
2024-01-25 01:45:09 +03:00
|
|
|
items:
|
2024-05-05 19:42:33 +03:00
|
|
|
$ref: '#/components/schemas/codeView'
|
|
|
|
type: array
|
|
|
|
message:
|
|
|
|
enum:
|
|
|
|
- ok_code
|
|
|
|
- invalid_code
|
|
|
|
- old_code
|
|
|
|
- next_level
|
|
|
|
- game_complete
|
|
|
|
type: string
|
|
|
|
text:
|
|
|
|
type: string
|
|
|
|
title:
|
|
|
|
type: string
|
2024-01-05 03:50:33 +03:00
|
|
|
required:
|
|
|
|
- title
|
|
|
|
- text
|
|
|
|
- codes
|
|
|
|
type: object
|
2024-05-05 19:42:33 +03:00
|
|
|
userView:
|
2024-01-05 03:50:33 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
email:
|
2023-11-19 22:54:54 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
expToCurrentLevel:
|
|
|
|
type: integer
|
|
|
|
expToNextLevel:
|
|
|
|
type: integer
|
|
|
|
experience:
|
|
|
|
type: integer
|
|
|
|
games:
|
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/gameView'
|
|
|
|
type: array
|
2024-04-29 23:01:24 +03:00
|
|
|
id:
|
|
|
|
format: uuid
|
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
level:
|
2024-04-29 23:01:24 +03:00
|
|
|
type: integer
|
2024-05-05 19:42:33 +03:00
|
|
|
role:
|
|
|
|
enum:
|
|
|
|
- user
|
|
|
|
- creator
|
|
|
|
- admin
|
|
|
|
type: string
|
|
|
|
username:
|
|
|
|
type: string
|
2024-04-29 23:01:24 +03:00
|
|
|
required:
|
|
|
|
- id
|
2024-05-05 19:42:33 +03:00
|
|
|
- username
|
|
|
|
- email
|
|
|
|
- experience
|
|
|
|
- level
|
|
|
|
- expToCurrentLevel
|
|
|
|
- expToNextLevel
|
|
|
|
- games
|
|
|
|
- role
|
|
|
|
type: object
|
|
|
|
securitySchemes:
|
|
|
|
cookieAuth:
|
|
|
|
in: cookie
|
|
|
|
name: session
|
|
|
|
type: apiKey
|
|
|
|
info:
|
|
|
|
title: nQuest
|
|
|
|
version: 1.0.0
|
|
|
|
openapi: 3.1.0
|
|
|
|
paths:
|
|
|
|
/admin/file/{quest}:
|
|
|
|
get:
|
|
|
|
operationId: adminListFiles
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: quest
|
|
|
|
required: true
|
2023-11-01 23:21:12 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/filesListResponse'
|
|
|
|
security:
|
|
|
|
- cookieAuth:
|
|
|
|
- creator
|
|
|
|
- admin
|
|
|
|
/admin/file/{quest}/upload:
|
|
|
|
post:
|
|
|
|
operationId: adminUploadFile
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: quest
|
|
|
|
required: true
|
2023-11-01 23:21:12 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
|
|
|
type: string
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
multipart/form-data:
|
2023-11-01 23:21:12 +03:00
|
|
|
properties:
|
2024-05-05 19:42:33 +03:00
|
|
|
file:
|
|
|
|
format: binary
|
2023-11-01 23:21:12 +03:00
|
|
|
type: string
|
2024-05-05 19:42:33 +03:00
|
|
|
schema: null
|
|
|
|
type: object
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/uploadResponse'
|
|
|
|
security:
|
|
|
|
- cookieAuth:
|
|
|
|
- creator
|
|
|
|
- admin
|
|
|
|
/admin/games:
|
|
|
|
get:
|
|
|
|
operationId: adminListGames
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/gameListResponse'
|
|
|
|
post:
|
|
|
|
operationId: adminEditGame
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/gameEdit'
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/gameAdminResponse'
|
|
|
|
security:
|
|
|
|
- cookieAuth:
|
|
|
|
- creator
|
|
|
|
- admin
|
|
|
|
/admin/games/{uid}:
|
|
|
|
get:
|
|
|
|
operationId: adminGetGame
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: uid
|
|
|
|
required: true
|
2023-11-19 22:54:54 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/gameAdminResponse'
|
|
|
|
security:
|
|
|
|
- cookieAuth:
|
|
|
|
- creator
|
|
|
|
- admin
|
|
|
|
/engine/{uid}:
|
|
|
|
get:
|
|
|
|
operationId: gameEngine
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: uid
|
|
|
|
required: true
|
2024-01-20 21:37:49 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/taskResponse'
|
|
|
|
/engine/{uid}/code:
|
|
|
|
post:
|
|
|
|
operationId: enterCode
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: uid
|
|
|
|
required: true
|
2024-04-29 23:01:24 +03:00
|
|
|
schema:
|
2024-05-05 19:42:33 +03:00
|
|
|
format: uuid
|
|
|
|
type: string
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
properties:
|
|
|
|
code:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- code
|
|
|
|
type: object
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/taskResponse'
|
|
|
|
/games:
|
|
|
|
get:
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/gameListResponse'
|
|
|
|
/user:
|
|
|
|
get:
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/userResponse'
|
|
|
|
403:
|
|
|
|
$ref: '#/components/responses/errorResponse'
|
|
|
|
/user/login:
|
|
|
|
post:
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- email
|
|
|
|
- password
|
|
|
|
type: object
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/userResponse'
|
|
|
|
400:
|
|
|
|
$ref: '#/components/responses/errorResponse'
|
|
|
|
security: []
|
|
|
|
/user/logout:
|
|
|
|
post:
|
|
|
|
responses:
|
|
|
|
204:
|
|
|
|
description: success logout
|
|
|
|
400:
|
|
|
|
$ref: '#/components/responses/errorResponse'
|
|
|
|
/user/register:
|
|
|
|
post:
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
password2:
|
|
|
|
type: string
|
|
|
|
username:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- username
|
|
|
|
- email
|
|
|
|
- password
|
|
|
|
- password2
|
|
|
|
type: object
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
$ref: '#/components/responses/userResponse'
|
|
|
|
400:
|
|
|
|
$ref: '#/components/responses/errorResponse'
|
|
|
|
security: []
|
2023-11-01 23:21:12 +03:00
|
|
|
security:
|
|
|
|
- cookieAuth: []
|
2024-05-05 19:42:33 +03:00
|
|
|
servers:
|
|
|
|
- url: /api
|