Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.0
- info:
- # You application title. Required.
- title: SkyProg
- # API version. You can use semantic versioning like 1.0.0,
- # or an arbitrary string like 0.99-beta. Required.
- version: 1.0.3
- paths:
- /auth/sign_up:
- post:
- description: Регистрация родителя
- parameters:
- - name: SUBJECT
- in: query
- schema:
- type: string
- description: Курс
- required: true
- tags:
- - parent
- operationId: sign_up
- responses:
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- id_parent:
- type: integer
- '400':
- description: request error
- requestBody:
- $ref: '#/components/requestBodies/Parent'
- /auth/sign_up/teacher:
- post:
- description: Регистрация учителя, у учителя может быть много курсов(SUBJECTS)
- tags:
- - teacher
- operationId: sign_up_teacher
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- id_teacher:
- type: integer
- requestBody:
- $ref: '#/components/requestBodies/sign_up_teacher'
- /auth/sign_up/admin:
- post:
- description: Регистрация админа
- tags:
- - admin
- operationId: sign_up_admin
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- id_admin:
- type: integer
- requestBody:
- $ref: '#/components/requestBodies/sign_up_admin'
- /auth/sign_in:
- post:
- description: auth пользователя, в зависимости от роли юзера выдается три разных response
- tags:
- - auth
- operationId: sign_in
- responses:
- '200':
- description: ok
- content:
- application/json:
- schema:
- oneOf:
- - $ref: '#/components/schemas/Parent_response'
- - $ref: '#/components/schemas/Admin_response'
- - $ref: '#/components/schemas/Teacher_response'
- '401':
- description: no such user
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- example: No such user
- requestBody:
- $ref: '#/components/requestBodies/login_pass'
- /add_child:
- post:
- description: Добавление ребенка к родителю
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- tags:
- - parent
- operationId: add_child
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_child:
- type: integer
- id_parent:
- type: integer
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- age:
- type: integer
- name_child:
- type: string
- subjects:
- type: string
- example: [1, subjcode_2]
- /child:
- get:
- description: инфа о ребенке
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- - in: query
- name: status
- description: posible status
- schema:
- type: integer
- enum: [0,1,2]
- tags:
- - child
- operationId: child
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- items:
- type: object
- properties:
- id_child:
- type: integer
- id_parent:
- type: integer
- subjects:
- example: [1, subject_code_2]
- age:
- type: integer
- id_match:
- type: integer
- id_teacher:
- type: integer
- date_match:
- type: string
- format: date-time
- status:
- type: integer
- /teacher:
- get:
- description: инфа об учителе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- tags:
- - teacher
- operationId: get_teacher
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_teacher:
- type: integer
- login:
- type: string
- password:
- type: string
- subjects:
- type: string
- example: [1, subjcode_2]
- skype:
- type: string
- mail:
- type: string
- date_reg:
- type: string
- format: date-time
- example: 07:38:07 17-Feb-20
- date_last:
- type: string
- format: date-time
- example: 07:38:07 17-Feb-20
- rating:
- type: number
- number_of_lessons:
- type: integer
- rates_number:
- type: integer
- post:
- tags:
- - teacher
- description: оценка учителю за урок
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: rate_teacher
- responses:
- '400':
- description: request error
- '200':
- description: ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_teacher:
- type: integer
- sum_rating:
- type: integer
- number_of_lessons:
- type: integer
- rates_number:
- type: integer
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- child_rate:
- type: integer
- put:
- tags:
- - teacher
- description: изменение информации об учителе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: edit_teacher
- responses:
- '400':
- description: request error
- '401':
- description: There is an user with such fields
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_teacher:
- type: integer
- name_teacher:
- type: string
- mail_teacher:
- type: string
- date_reg:
- type: string
- example: 10:15:02 17-Feb-20
- date_last:
- type: string
- example: 10:15:02 17-Feb-20
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- name_teacher:
- type: string
- mail_teacher:
- type: string
- phone_teacher:
- type: string
- /teacher/match:
- get:
- tags:
- - teacher
- description: все ученики учителя
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- - in: query
- name: status
- schema:
- type: integer
- enum: [0,1,2]
- description: статусы - ждёт подтверждения(0), отклонил(1), принял(2)
- required: true
- operationId: match_get_teacher
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- properties:
- id_match:
- type: integer
- id_child:
- type: integer
- id_teacher:
- type: integer
- status:
- type: integer
- date_match:
- type: string
- format: date-time
- post:
- tags:
- - teacher
- description: кидает заявку на прохождение курса, происходит подбор учителя
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- - in: query
- name: status
- schema:
- type: integer
- enum: [0,1,2]
- description: статусы - ждёт подтверждения(0), отклонил(1), принял(2)
- operationId: match_post_teacher
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- id_match:
- type: integer
- status:
- type: integer
- /user:
- get:
- tags:
- - parent
- description: информация о родителе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: get_parent
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_parent:
- type: integer
- name_parent:
- type: string
- phone_parent:
- type: string
- mail_parent:
- type: string
- date_reg:
- type: string
- example: 10:15:02 17-Feb-20
- date_last:
- type: string
- example: 10:15:02 17-Feb-20
- put:
- tags:
- - parent
- description: изменение информации о родителе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: edit_parent
- responses:
- '400':
- description: request error
- '401':
- description: There is an user with such fields
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_parent:
- type: integer
- login:
- type: string
- name_parent:
- type: string
- phone_parent:
- type: string
- mail_parent:
- type: string
- date_reg:
- type: string
- example: 10:15:02 17-Feb-20
- date_last:
- type: string
- example: 10:15:02 17-Feb-20
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- name_parent:
- type: string
- phone_parent:
- type: string
- mail_parent:
- type: string
- /admin:
- get:
- tags:
- - admin
- description: информация об админе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: get_admin
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_admin:
- type: integer
- name:
- type: string
- mail:
- type: string
- date_reg:
- example: "07:40:24 18-Feb-20"
- date_last:
- example: "07:40:24 18-Feb-20"
- put:
- tags:
- - admin
- description: изменение информации об админе
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: edit_admin
- responses:
- '400':
- description: request error
- '401':
- description: There is an user with such fields
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: object
- properties:
- id_admin:
- type: integer
- name_admin:
- type: string
- mail_admin:
- type: string
- date_reg:
- type: string
- example: 10:15:02 17-Feb-20
- date_last:
- type: string
- example: 10:15:02 17-Feb-20
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- name_admin:
- type: string
- mail_admin:
- type: string
- phone_admin:
- type: string
- /subject:
- get:
- tags:
- - subject
- description: информация о курсах
- parameters:
- - in: header
- name: token
- schema:
- type: string
- required: true
- operationId: get_subjects
- responses:
- '400':
- description: request error
- '200':
- description: all ok
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- properties:
- id_subject:
- type: integer
- name_subject:
- type: string
- img:
- type: string
- price:
- type: string
- duration:
- type: string
- description:
- type: string
- components:
- schemas:
- Parent_response:
- type: object
- properties:
- token:
- type: string
- id_parent:
- type: string
- Admin_response:
- type: object
- properties:
- token:
- type: string
- id_admin:
- type: string
- Teacher_response:
- type: object
- properties:
- token:
- type: string
- id_teacher:
- type: string
- sign_up_teacher:
- type: object
- properties:
- login:
- type: string
- password:
- type: string
- name:
- type: string
- mail:
- type: string
- subjects:
- type: integer
- example: [ 1, 2, subjcode_3]
- uniqueItems: true
- sign_up_admin:
- type: object
- properties:
- login:
- type: string
- password:
- type: string
- name:
- type: string
- mail:
- type: string
- login_pass:
- type: object
- properties:
- login:
- type: string
- password:
- type: string
- Parent:
- type: object
- properties:
- login:
- type: string
- password:
- type: string
- name_parent:
- type: string
- name_child:
- type: string
- age:
- type: integer
- phone_parent:
- type: string
- mail_parent:
- type: string
- requestBodies:
- sign_up_teacher:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/sign_up_teacher'
- sign_up_admin:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/sign_up_admin'
- Parent:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Parent'
- required: true
- login_pass:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/login_pass'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement