Skip to content

Sprint 9 solution http api#6

Merged
dendzim merged 5 commits into
mainfrom
sprint_9-solution-http-api
Oct 1, 2025
Merged

Sprint 9 solution http api#6
dendzim merged 5 commits into
mainfrom
sprint_9-solution-http-api

Conversation

@dendzim
Copy link
Copy Markdown
Owner

@dendzim dendzim commented Sep 30, 2025

Реализован функционал согласно ТЗ 9-ого спринта.
Добавлен Http сервер с реализациями обработчиков под разные запросы.
Добавлены тесты для новой функицональности.

Comment thread src/http/adapters/DurationAdapter.java Outdated
import java.io.IOException;
import java.time.Duration;

public class DurationAdapter extends TypeAdapter<java.time.Duration> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

java.time. лишнее, достаточно того что есть секция import java.time.Duration;

Comment thread src/http/handlers/BaseHttpHandler.java Outdated

protected void sendNotFound(HttpExchange h) throws IOException {
byte[] resp = "Not Found".getBytes(StandardCharsets.UTF_8);
h.getResponseHeaders().add("Content-Type", "application/json;charset=utf-8");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Т.к. здесь мы отдаем не json а просто текст, то лучше
("Content-Type", "text/plain")

Comment thread src/http/handlers/BaseHttpHandler.java Outdated

protected void sendHasOverlaps(HttpExchange h) throws IOException {
byte[] resp = "Not Acceptable".getBytes(StandardCharsets.UTF_8);
h.getResponseHeaders().add("Content-Type", "application/json;charset=utf-8");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

См. коммент выше

Copy link
Copy Markdown

@VadimZharkov VadimZharkov left a comment

Choose a reason for hiding this comment

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

Хорошая работа, в целом все верно. Оставил пару уточнений.

@dendzim dendzim merged commit 9f0066f into main Oct 1, 2025
1 check passed
@dendzim dendzim deleted the sprint_9-solution-http-api branch October 1, 2025 11:05
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