Практика
GET
/schedules/
{groupId}
GET
/groups
GET
/person/
{userId}
PUT
/schedules/
{scheduleId}
GET
/teachers
GET
/classes
POST
/login
POST
/schedules/create
GET
/lessons/
{teacherId}
DELETE
/schedules/
{scheduleId}
GET
/schedules/
{groupId}
Path variables
groupId
string
required
Responses
200
OK
Body
Array
Object
lessonId
integer
lessonName
string
Название предмета
date
string
Дата предмета. Например 2024-06-19T09:51:13+0000
teacher
Преподаватель
group
Группа, у которой будет пара
class
Аудитория, в которой будет пара
scheduleId
integer
id расписания
pairNumber
integer
Номер пары. Всего пар от 0 до 8
Example:
2
Example 1
GET /schedules/{groupId} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"lessonId": 1,
"lessonName": "",
"date": "",
"teacher": {
"id": 1,
"name": "",
"surname": ""
},
"group": {
"id": 1,
"number": "102М"
},
"class": {
"id": 1,
"number": ""
},
"scheduleId": 1,
"pairNumber": 2
}
]
GET
/groups
Notes
Доступно админам и преподавателям
Responses
200
OK
Body
Object
groups
Example 1
GET /groups/{teacherId} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups": [
{
"id": 1,
"number": "102М"
}
]
}
PUT
/schedules/
{scheduleId}
Path variables
scheduleId
string
required
id изменяемого расписания
Notes
Изменения в расписании. Доступно только преподавателям и админам
Request body
Object
teacherId
integer
nullable
id нового преподавателя для этого предмета
lessonId
integer
nullable
id нового предмета
classId
integer
nullable
id новой аудитории
groupId
integer
nullable
id новой группы
date
string
Дата пары
pairNumber
integer
номер пары
Responses
200
OK
Body
Object
success
boolean
Успех выполнения
error
string
nullable
Текст ошибки в случае неудачи
Example 1
PUT /schedule/{scheduleId} HTTP/1.1
Content-Type: application/json
{
"teacherId": 1,
"lessonId": 1,
"classId": 1,
"groupId": 1,
"date": "",
"pairNumber": 1
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"error": ""
}
GET
/teachers
Notes
Думаю, этот запрос будет возможность дернуть только у пользователя с типом “admin”
Responses
200
OK
Body
Object
teachers
Example 1
GET /teachers HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"teachers": [
{
"id": 1,
"name": "",
"surname": ""
}
]
}
GET
/classes
Notes
Доступно админам и преподавателям
Responses
200
OK
Body
Object
classes
Example 1
GET /classes HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"classes": [
{
"id": 1,
"number": ""
}
]
}
POST
/login
Request body
Object
login
string
password
string
Responses
201
Created
Body
Object
login
string
password
string
id
integer
Example 1
POST /login HTTP/1.1
Content-Type: application/json
{
"login": "",
"password": ""
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"login": "",
"password": "",
"id": 1
}
POST
/schedules/create
Request body
Object
teacherId
integer
id преподавателя
classId
integer
id аудитории
groupId
integer
id группы
lessonId
integer
id предмета
date
string
дата пары
pairNumber
integer
номер пары
Responses
201
Created
Body
Object
success
boolean
error
string
nullable
Текст ошибки в ходе провала
Example 1
POST /schedule/create HTTP/1.1
Content-Type: application/json
{
"teacherId": 1,
"classId": 1,
"groupId": 1,
"lessonId": 1,
"date": "",
"pairNumber": 1
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"success": true,
"error": ""
}
GET
/lessons/
{teacherId}
Path variables
teacherId
string
optional
id преподавателя. Если приходит null, то шлем все
Responses
200
OK
Body
Object
lessons
Example 1
GET /lessons/{teacherId} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"lessons": [
{
"id": 1,
"name": ""
}
]
}