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

Feature/add dto layer #61

Closed
wants to merge 2 commits into from

Conversation

anishmu20
Copy link
Contributor

Overview:

This PR introduces several enhancements and corrections to the library management system, particularly focusing on the API functionalities and code maintainability. Below are the detailed changes made:

1.Added Data Transfer Object (DTO) Layer:

Implemented a DTO layer for the module whose entity is exposed in the controller. This change facilitates data encapsulation and improves the separation of concerns.

2.Corrected Borrowing API (BorrowBook API):
Resolved an issue where the BorrowBook API was returning null for both book and member records. The API is now functioning correctly and provides the expected output.

3.Updated Return Book API:

The Return Book API was previously not returning any value. This has been corrected, and the return structure now aligns with the borrowing API documentation.

4.Lombok Dependency Implementation:
Integrated Lombok to reduce boilerplate code. Getter and setter methods, as well as constructors, have been generated using Lombok annotations, enhancing code readability and maintainability.

5.Introduced ModelMapper:
Implemented ModelMapper to facilitate seamless conversion between DTO and entity objects, ensuring cleaner and more efficient data handling.
Notification Table
members Table
Borrowings Table
Borrowings Table

6.API Testing:
Conducted thorough testing of all APIs using Postman to ensure that all functionalities are working as expected.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🎉 Thank you @anishmu20 for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better.

@anishmu20
Copy link
Contributor Author

Feature/add dto layer
#52

Copy link
Owner

@ajaynegi45 ajaynegi45 left a comment

Choose a reason for hiding this comment

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

Hi @anishmu20,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I need some changes.

  • Check code comment and resolve them.
  • Before making pull request always make sure to pull changes from upstream main branch.

Once again, thank you for your contribution! ❤️

@@ -37,6 +37,17 @@
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use lombok.

</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use modelmapper. Implement it manually

@@ -33,91 +41,5 @@ public class Book {
@Column(name = "copies_available", nullable = false)
private int copiesAvailable;

public Book() {
Copy link
Owner

Choose a reason for hiding this comment

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

Why you remove this code. Don't use lombok.

@@ -1,2 +1,3 @@
spring.application.name=libraryman-api
Copy link
Owner

Choose a reason for hiding this comment

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

Make this file as it was earlier.

@@ -4,42 +4,45 @@
## Make this file as it was earlier before commiting code

# Change this connection string to this format: jdbc:mysql://{ip_address}:{port}/{database_name}
spring.datasource.url=jdbc:mysql://localhost:3306/Add_Your_Database_Name
spring.datasource.url=jdbc:mysql://localhost:3306/DATABASE NAME
Copy link
Owner

Choose a reason for hiding this comment

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

Make this file as it was earlier

@ajaynegi45 ajaynegi45 closed this Oct 4, 2024
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