Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/post #20

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Fix/post #20

merged 4 commits into from
Aug 26, 2024

Conversation

NishthaLath
Copy link
Collaborator

The code works great and there weren't many necessary issues to be corrected but i have tried my best to make it more efficient and readable.

  • Updated Post.java, PostRepository.java, PostService.java
  • No changes to PostController.java

Thank you, Looking forward to any suggestions.

The code runs great and didn't needed lot of changes. Therefore i have tried my best to improve the performance and error handling of the code.

- Removed "comments" field as not needed anymore
- Added @notblank and @NotNull annotations to ensure that title, content, and user are always provided.
- Added fetch = FetchType.LAZY to the User relationship to improve performance by loading user data only when needed.
- Added a method findByTag to retrieve posts by tag directly from the database (Improve Memory efficiency)
The method helps further in PostService.java code.
- Using findByTag method directly in getPostsByTag to improve efficiency.
- Added a custom exception (RuntimeException) to handle cases where a post is not found.
- Added @transactional annotation to updatePost and deletePost methods to ensure proper data management.
@Village-GG-Water
Copy link
Collaborator

javax.validation.constraints package가 존재하지 않는다고 하니 확인 부탁드립니다.

@LAPLACE4A
Copy link
Collaborator

javax.validation.constraints package가 존재하지 않는다고 하니 확인 부탁드립니다.

17cafdb
deprecated된 어노테이션으로 작업하셨길래 바꿨습니다

@NishthaLath
Copy link
Collaborator Author

javax.validation.constraints package가 존재하지 않는다고 하니 확인 부탁드립니다.

17cafdb deprecated된 어노테이션으로 작업하셨길래 바꿨습니다

Thank you

Copy link
Collaborator

@Village-GG-Water Village-GG-Water left a comment

Choose a reason for hiding this comment

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

LGTM

@Village-GG-Water Village-GG-Water merged commit 8c9f151 into dev Aug 26, 2024
2 checks passed
@Village-GG-Water Village-GG-Water deleted the Fix/Post branch August 26, 2024 22:23
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.

3 participants