Skip to content

Sprint 9 solution http api - #5

Merged
AleksOBM merged 3 commits into
mainfrom
sprint_9-solution-http-api
Nov 26, 2025
Merged

Sprint 9 solution http api#5
AleksOBM merged 3 commits into
mainfrom
sprint_9-solution-http-api

Conversation

@AleksOBM

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/server/handlers/EpicsHandler.java Outdated
}

if (manager.addEpic(epic) == null) {
sendHasOverlaps(exchange, Endpoint.POST_NEW_EPIC, epic);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

эпики не хранятся в prioritizedTasks и не проверяются на пересечение

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

Comment thread src/server/handlers/EpicsHandler.java Outdated
if (manager.addEpic(epic) == null) {
sendHasOverlaps(exchange, Endpoint.POST_NEW_EPIC, epic);
} else {
sendText(exchange, Endpoint.POST_NEW_EPIC,"epic adding success");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

после создания новой сущности, в ответе нужно сообщить присвоенное ей id, по-другому "на том конце провода" его никак не узнают

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

Comment thread src/server/handlers/EpicsHandler.java Outdated
return;
}

Epic epic = manager.getEpic(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

метод getAllSubTasksByEpic() сам вернет null, если эпика нет, поэтому отдельно получать сам эпик не нужно

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

}

if (manager.addSubtask(subtask) == null) {
sendHasOverlaps(exchange, Endpoint.POST_NEW_SUBTASK, subtask);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему ты решил, что именно пересечение? может там id эпика не верно указано? Нужно как-то разделить ответы метода для этих случаев

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

if (manager.addSubtask(subtask) == null) {
sendHasOverlaps(exchange, Endpoint.POST_NEW_SUBTASK, subtask);
} else {
sendText(exchange, Endpoint.POST_NEW_SUBTASK,"subtask adding success");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сюда тоже нужно сообщить новое id

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

}

if (manager.updateSubtask(subtask) == null) {
sendNotFound(exchange, Endpoint.POST_UPDATE_SUBTASK);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут аналогичная ситуация, что null можно получить в нескольких случаях

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

Comment thread src/server/handlers/TasksHandler.java Outdated
if (manager.addTask(task) == null) {
sendHasOverlaps(exchange, Endpoint.POST_NEW_TASK, task);
} else {
sendText(exchange, Endpoint.POST_NEW_TASK,"task adding success");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут тоже нужно id в ответ

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

готово

@AleksOBM
AleksOBM merged commit 4d8ae29 into main Nov 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants