Skip to content

Add item requests and gateway#3

Merged
zephyr0021 merged 37 commits intomainfrom
add-item-requests-and-gateway
Aug 14, 2025
Merged

Add item requests and gateway#3
zephyr0021 merged 37 commits intomainfrom
add-item-requests-and-gateway

Conversation

@zephyr0021
Copy link
Owner

Выполнил ТЗ 16 спринта

server/pom.xml Outdated
Comment on lines +76 to +79
<groupId>com.opentable.components</groupId>
<artifactId>otj-pg-embedded</artifactId>
<version>0.13.3</version>
<scope>test</scope>
Copy link

Choose a reason for hiding this comment

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

почему h2 решил не использовать для тестов?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Была вот такая ошибка: Hibernate при работе с PostgreSQL использует RETURNING id, чтобы сразу получить сгенерированный ключ. Но H2 (особенно старые версии <2.0.202) не поддерживает RETURNING в INSERT, и валится с синтаксической ошибкой
Так же еще были какие то ошибки, поэтому решил переключить на полный постгрес тесты. Однако если критично могу попробовать переключить обратно в h2 режим и пофиксить баги. Т.к h2 работает заметно быстрее)

Copy link
Owner Author

Choose a reason for hiding this comment

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

Хм странно но сейчас работает. Переключил на H2)))

private User owner;

@Column(name = "request_id")
private Long requestId;
Copy link

Choose a reason for hiding this comment

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

почему для owner подтягиваем данные целиком,
а для item request только id?

Copy link
Owner Author

Choose a reason for hiding this comment

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

видимо пропустил. поправил

@@ -0,0 +1,45 @@
CREATE TABLE IF NOT EXISTS users
Copy link

Choose a reason for hiding this comment

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

в тестах можно использовать основную схему

когда два файла, нужно дополнительно следить, чтобы данные в них не расходились

Copy link
Owner Author

Choose a reason for hiding this comment

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

Поправил

created TIMESTAMP WITHOUT TIME ZONE
) No newline at end of file
);

Copy link

Choose a reason for hiding this comment

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

в таблице items можно поставить референс на id из requests

Copy link
Owner Author

Choose a reason for hiding this comment

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

точно пропустил) поправил

@zephyr0021 zephyr0021 merged commit 9964175 into main Aug 14, 2025
2 checks 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