-
Notifications
You must be signed in to change notification settings - Fork 22
Image upload API created #135
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a new image upload API endpoint for chat functionality, allowing users to upload images that will be stored in the database and associated with sender and receiver users.
Key Changes:
- New REST endpoint
/api/auth/upload-imageto handle multipart file uploads - New
ChatImageDtoJPA entity to store image binary data with sender/receiver relationships - Custom native query in
ChatImageRepofor inserting images with PostgreSQL bytea type handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| backend/src/main/java/vaultWeb/controllers/UserController.java | Adds POST endpoint for image uploads with multipart file handling |
| backend/src/main/java/vaultWeb/services/UserService.java | Implements image upload business logic and orchestrates repository calls |
| backend/src/main/java/vaultWeb/repositories/ChatImageRepo.java | Defines repository interface with custom native SQL INSERT query for image storage |
| backend/src/main/java/vaultWeb/dtos/ChatImageDto.java | Creates JPA entity for chat_images table with bytea column for binary data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@DenizAltunkapan Can you please review this PR, i fixed issues suggested by copilot. |
|
@DenizAltunkapan i fixed the issue using mvn spotless:apply and ./mvnw spotless:check locally. You can check again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/main/java/vaultWeb/controllers/ChatImageController.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/vaultWeb/exceptions/GlobalExceptionHandler.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/vaultWeb/controllers/ChatImageController.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/vaultWeb/controllers/ChatImageController.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/main/java/vaultWeb/controllers/ChatImageController.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/vaultWeb/exceptions/GlobalExceptionHandler.java
Outdated
Show resolved
Hide resolved
|
@ABHISHEK0S1INGH you forgot the formatting haha |
recheck formatted now @DenizAltunkapan |
|
@ABHISHEK0S1INGH when are you planning to implement the corresponding frontend code? |
|
Hi @DenizAltunkapan, I’ve started reviewing the code. Since I’m focused on backend development, it might take a little time to go through everything thoroughly. |
|
@ABHISHEK0S1INGH The issue was about sending images in private chats, meaning:
This PR currently only handles file upload but stops before integrating the uploaded image into the chat system. Could you extend the PR to include the missing functionality so that images actually appear as chat messages? |
Hi @DenizAltunkapan , Thanks for the detailed feedback! I’ll update the PR accordingly soon. |
No description provided.