Closed atkaksoy501 closed 6 months ago
The update introduces a data transfer object (DTO) layer for department information in the application. It modifies the DepartmentsController
to return DepartmentDTO
objects instead of Department
entities, ensuring a separation of concerns. Additionally, it includes the implementation of mapping logic in both the service interface and its concrete implementation, leveraging a ModelMapperService
for converting entities to DTOs, streamlining the data handling process between the application layers.
File Path | Change Summary |
---|---|
.../controllers/DepartmentsController.java |
Added DepartmentDTO import, changed getAll return type to List<DepartmentDTO> , added entity to DTO mapping logic. |
.../DTOs/responses/DepartmentDTO.java |
Added DepartmentDTO class for department data representation. |
.../abstracts/IDepartmentService.java |
Added mapToDto and mapAllToDto methods for entity to DTO conversion. |
.../concretes/DepartmentService.java |
Implemented mapToDto and mapAllToDto using ModelMapperService . |
🐰✨
In the land of code, where changes abound,
A rabbit hopped in, with ideas so sound.
"Let's map," it said, with a twinkle in its eye,
"Entities to DTOs, and let our data fly!"
Through layers and services, the mapping was done,
Now data flows sleekly, oh what fun!
🌟🚀🐇
Summary by CodeRabbit