Skip to content

Commit

Permalink
feat: Tutorial (#8)
Browse files Browse the repository at this point in the history
* feat: tutorials

* fix: dashboard

* fix: pvpLeaderboard, battleaTV

---------

Co-authored-by: shubham-1806 <[email protected]>
  • Loading branch information
2 people authored and bhoopesh369 committed Feb 11, 2024
1 parent 344433f commit deac350
Show file tree
Hide file tree
Showing 29 changed files with 1,288 additions and 134 deletions.
150 changes: 150 additions & 0 deletions docs/spec/CodeCharacter-API.yml
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ paths:
college: NITT
avatarId: 1
tutorialLevel: 2
codeTutorialLevel: 3
tier: TIER1
isProfileComplete: true
isTutorialComplete: true
Expand Down Expand Up @@ -1588,6 +1589,73 @@ paths:
description: Gets all statistics for the current user
parameters: []

'/codetutorial/get/{codeTutorialNumber}':
get:
summary: Get tutorial by number
description: Get a single tutorial
operationId: getCodeTutorialByNumber
parameters:
- name: codeTutorialNumber
in: path
required: true
schema:
type: integer
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TutorialsGetRequest'
401:
description: Unauthorized
403:
description: Forbidden
404:
description: Not found
tags:
- Tutorials

/codetutorial/submit:
post:
summary: Match Execution for Tutorials
description: Match making for Tutorials
operationId: createCodeTutorialMatch
responses:
'201':
description: Created
'400':
description: Bad Request
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
examples:
Example:
value:
message: Some field missing
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CodeTutorialMatchRequest'
examples:
CodeExample:
value:
value: '#include<iostream>'
language: CPP
codeTutorialNumber: 2
MapExample:
value:
value: '[[0,0,0]]'
codeTutorialNumber: 6
tags:
- Tutorials

components:
schemas:
UserMatchStats:
Expand Down Expand Up @@ -2060,6 +2128,9 @@ components:
tutorialLevel:
type: integer
example: 1
codeTutorialLevel:
type: integer
example: 3
tier:
$ref: '#/components/schemas/TierType'
isProfileComplete:
Expand All @@ -2077,6 +2148,7 @@ components:
- college
- avatarId
- tutorialLevel
- codeTutorialLevel
- isProfileComplete
- isTutorialComplete
UpdateCurrentUserProfile:
Expand Down Expand Up @@ -2296,6 +2368,29 @@ components:
- destruction
- coinsUsed
- status
TutorialGame:
title: Game
type: object
description: Game model
properties:
id:
type: string
format: uuid
example: 123e4567-e89b-12d3-a456-426614174000
destruction:
type: number
example: 100
coinsUsed:
type: integer
logs:
type: string
status:
$ref: '#/components/schemas/GameStatus'
required:
- id
- destruction
- coinsUsed
- status
GameLog:
type: string
description: Game log model
Expand Down Expand Up @@ -2351,6 +2446,45 @@ components:
required:
- user
- stats
TutorialsGetRequest:
title: Get tutorials
description: Get the game tutorials
type: object
properties:
tutorialId:
type: integer
example: 1
tutorialName:
type: string
example: Tutorial for Spawning attacker
tutorialType:
$ref: '#/components/schemas/ChallengeType'
description:
type: string
example: Brief description of how the code works
tutorialCodes:
$ref: '#/components/schemas/TutorialCodeObject'
required:
- tutorialId
- tutorialName
- tutorialCodes

TutorialCodeObject:
title: Tutorial Code Object
description: The object containing the code for the tutorial
type: object
properties:
cpp:
type: string
example: This would have the cpp code for the tutorial
java:
type: string
example: This would have the java code for the tutorial
python:
type: string
example: This would have the python code for the tutorial
image:
type: string

DailyChallengeGetRequest:
title: Get daily challenge
Expand Down Expand Up @@ -2417,6 +2551,22 @@ components:
$ref: '#/components/schemas/Language'
required:
- value
CodeTutorialMatchRequest:
title: CodeTutorialMatchRequest
description: Request Model for the tutorial mode
type: object
properties:
value:
type: string
example: '#include<iostream>'
language:
$ref: '#/components/schemas/Language'
codeTutorialNumber:
type: integer
nullable: false
required:
- value
- codeTutorialNumber
GenericError:
title: GenericError
type: object
Expand Down
1 change: 1 addition & 0 deletions packages/client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ src/apis/MatchApi.ts
src/apis/NotificationApi.ts
src/apis/PvpGameApi.ts
src/apis/StatsApi.ts
src/apis/TutorialsApi.ts
src/apis/UserApi.ts
src/apis/index.ts
src/index.ts
Expand Down
Loading

0 comments on commit deac350

Please sign in to comment.