2055Java-Nick / Rev-Connect-API

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

feature/fifunmitimothy tags taggedusers #53

Closed themellowpea closed 2 months ago

themellowpea commented 2 months ago

TL;DR

This PR introduces the functionality to tag posts and tag users in posts. It includes updates to the database schema, models, DTOs, service layer, mappers, and controllers to fully support the creation, retrieval, and updating of posts with associated tags and tagged users. The goal is to enhance user engagement by allowing more detailed categorization and interaction within posts.

Description

1. DB Schema Updates

3. DTO Updates:

4. Service Layer Updates:

5. Mapper Updates:

6. Controller Layer Updates:

7. Testing:

Examples:

Creating a Post with Tags and Tagged Users:

Request Body:

{
    "authorId": 1,
    "title": "New Feature Announcement",
    "content": "We just launched a new feature!",
    "tagNames": ["Feature", "Announcement"],
    "taggedUserIds": [2, 3]
}

Response Body

{
    "postId": 10,
    "authorId": 1,
    "title": "New Feature Announcement",
    "content": "We just launched a new feature!",
    "createdAt": "2024-08-29T10:15:30",
    "updatedAt": "2024-08-29T10:15:30",
    "tagNames": ["Feature", "Announcement"],
    "taggedUsernames": ["testuser2", "testuser3"]
}