В данной спецификации описан некоторый функционал для взаимодействия пациента с веб-приложением медцентра (Листинг 7.1):
Листинг 7.1 - Спецификация openAPI
openapi: 3.0.0
info:
title: Dr.Vita API
version: 1.0.0
description: API для взаимодействия с медицинским центром
paths:
/login:
post:
summary: Авторизация пользователя
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
responses:
'200':
description: Успешная авторизация
content:
application/json:
schema:
type: object
properties:
access_token:
type: string
token_type:
type: string
/profile:
get:
summary: Получение информации о профиле пользователя
parameters:
- name: userId
in: query
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Успешное получение профиля
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
firstName:
type: string
lastName:
type: string
patronymic:
type: string
birthDate:
type: string
format: date
phone:
type: string
email:
type: string
patch:
summary: Обновление информации о профиле пользователя
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
firstName:
type: string
lastName:
type: string
patronymic:
type: string
birthDate:
type: string
format: date
phone:
type: string
email:
type: string
responses:
'200':
description: Успешное обновление профиля
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
firstName:
type: string
lastName:
type: string
patronymic:
type: string
birthDate:
type: string
format: date
phone:
type: string
email:
type: string
/profile/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
delete:
summary: Удаление профиля пользователя
responses:
'200':
description: Успешное удаление профиля пользователя
/appointments:
post:
summary: Создание записи на прием
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
service:
type: string
doctor:
type: string
date:
type: string
format: date
time:
type: string
format: time
comment:
type: string
userId:
type: string
format: uuid
responses:
'200':
description: Успешное создание записи на прием
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
userId:
type: string
format: uuid
service:
type: string
doctor:
type: string
date:
type: string
format: date
time:
type: string
format: time
comment:
type: string
get:
summary: Получение списка записей на прием
parameters:
- name: userId
in: query
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Успешное получение списка записей на прием
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
userId:
type: string
format: uuid
service:
type: string
doctor:
type: string
date:
type: string
format: date
time:
type: string
format: time
room:
type: integer
floor:
type: integer
/appointments/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
delete:
summary: Отмена записи на прием
responses:
'200':
description: Успешная отмена записи на прием