User Management (Users)
GET/api/users/writers-all?page=1&limit=10Authentication required
Lists writers with pagination. `page` defaults to 1, `limit` defaults to 10, max 100.
GET/api/users/get/:idAuthentication required
Returns the specified user. Returns 404 Not Found if the user does not exist.
PATCH/api/users/change-passwordAuthentication required
Updates the password of the signed-in user.
Example request body
{
"oldPassword": "EskiŞifre123!",
"newPassword": "YeniŞifre456!"
}
DELETE/api/users/delete/:idAuthentication required
Deletes the token owner's account. Known issue: returned 500 in testing; the blog repository dependency required by UserService is not provided.
Blog Management (Blogs)
GET/api/blogs/all?page=1&limit=10
Lists blogs with pagination. `page` defaults to 1, `limit` defaults to 10, max 100.
GET/api/blogs/get/:id
Returns the specified blog. If the record is not found, the current code may return 200 OK with null.
GET/api/blogs/detail/:id
Returns the blog detail and its related blog object. Known issue: returned 500 in testing; the query uses an `isActive` field that does not exist on the BlogDetail model.
POST/api/blogs/createAuthentication required
Creates a new blog. Requires the `writer` or `admin` role. `summary` is optional; `authorId` is taken from the token. Because Blog.content has a unique index, each blog must use a different `content` value.
Example request body
{
"title": "Örnek başlık",
"content": "Benzersiz blog içeriği",
"summary": "Kısa özet"
}
PUT/api/blogs/update/:idAuthentication required
Updates a blog. Requires the `writer` or `admin` role. Known issue: returned 500 in testing; the controller does not pass the update fields to the service method in the expected object shape.
Example request body
{
"title": "Güncel başlık",
"content": "Yeni ve benzersiz içerik",
"summary": "Güncel özet"
}
DELETE/api/blogs/delete/:idAuthentication required
Deletes/deactivates a blog. Requires the `writer` or `admin` role. Returns the deleted/deactivated blog object.