Here are the Postman requests corresponding to the PostController
API you've shared:
GET /posts/{postId}
GET http://localhost:8080/posts/{postId}
GET http://localhost:8080/posts/1
{
"id": 1,
"content": "This is the content of the post.",
"authorId": 101,
"projectId": 202
}
GET /posts/user/{userId}
GET http://localhost:8080/posts/user/{userId}
GET http://localhost:8080/posts/user/1
[
{
"id": 1,
"content": "First post by the user.",
"authorId": 1,
"projectId": 101
},
{
"id": 2,
"content": "Second post by the user.",
"authorId": 1,
"projectId": 102
}
]
POST /posts
POST http://localhost:8080/posts
Content-Type: application/json
{
"content": "This is a new post",
"authorId": 1,
"projectId": 101
}
{
"id": 3,
"content": "This is a new post",
"authorId": 1,
"projectId": 101
}
PATCH /posts/{postId}
PATCH http://localhost:8080/posts/{postId}
Content-Type: application/json
PATCH http://localhost:8080/posts/1
{
"content": "This is the updated content"
}
{
"id": 1,
"content": "This is the updated content",
"authorId": 1,
"projectId": 101
}
DELETE /posts/{postId}
DELETE http://localhost:8080/posts/{postId}
DELETE http://localhost:8080/posts/1
HTTP 200 OK (No content)
You can directly use these queries in Postman by replacing localhost:8080
with the actual domain or IP where your service is running, and adjust the paths and bodies as needed for your requests.