2055Java-Nick / Rev-Connect-API

Spring service for Rec Connect application
0 stars 3 forks source link

hotfix/fix post controller #39

Closed themellowpea closed 2 weeks ago

themellowpea commented 2 weeks ago

TL;DR

Description

This PR encapsulates a series of changes and enhancements to implement and test the /posts endpoint fully. Below is a detailed breakdown of the changes:

Commits Overview:

  1. update posts table names:
    • Refined the posts table structure by updating column names for better clarity and alignment with project conventions.
  2. use LocalDateTime:
    • Updated timestamp fields to use LocalDateTime for accurate date-time handling in the Post entity.
  3. change bigint to long:
    • Changed column types from bigint to long where appropriate, ensuring consistency with Java data types.
  4. configure PostService, add all CRUD endpoints:
    • Implemented the full range of CRUD operations within the PostService and exposed them via PostController.
    • Introduced methods to create, read, update, and delete posts.
  5. update PostController, comment test code out:
    • Updated the PostController to integrate the new CRUD operations.
    • Temporarily commented out some test code for further refinement and integration.
  6. setup DTO objects and MapStruct mapper interface, update service layer:
    • Created PostRequestDTO and PostResponseDTO for clean data handling.
    • Configured MapStruct for automatic mapping between DTOs and entities.
    • Refined the service layer to utilize these DTOs effectively.
  7. add tests for PostController and update MapStruct and Lombok configurations:
    • Developed comprehensive unit tests for the PostController to ensure robust functionality.
    • Updated MapStruct and Lombok configurations to support the new DTO mappings and service logic.
  8. update posts table and fix sequence generation:
    • Finalized the posts table updates and fixed issues related to sequence generation, ensuring smooth operation during data insertion and retrieval.