I have developed this REST API for an Blog Application. This API performs all the fundamental CRUD operations of any Blog Application with user validation at every step.
Installation & Run all End Point see on the Swagger -url after run the project on localMachine or Computer
run this command in your local Machine or PC
git clone https://github.com/sav98aman/Adobe_Assignments.git
Before running the API server, you should update the database config inside the application.properties file. Update the port number, username and password as per your local database config.
server.port=8080
spring.datasource.url=jdbc:mysql://localhost:3306/ADOBE;
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
http://localhost:8888/swagger-ui/index.html
POST /users
: Register ( Create new Account )PUT /users/{user_id}
: Update the User name and Bio byuser_id
DELETE /users/{user_id}
: Delete User byuser_id
GET /users/{user_id}
: Getting a particular User Details byuser_id
GET /analytics/users
: Getting total number of UserGET /analytics/users/top-active
5 Top Active Users
POST /posts
: Create a new PostPUT /posts/{post_id}
: Update the Content bypost_id
DELETE /posts/{post_id}
: Delete a Post bypost_id
POST /posts/{post_id}/like
: Update a Like value bypost_id
POST /posts/{post_id}/unlike
: Update a Like value by decreasing 1 bypost_id
GET /posts/{post_id}
: Getting a particular post bypost_id
GET /analytics/posts
: Getting total number of PostGET /analytics/posts/top-active
Top 5 Most liked Post
Request Body for User
{
"userName":"amankumar",
"email":"[email protected]",
"bio":"Hello Ji i am Aman Kumar verma",
"password":"1234"
}
Response Body
{
"data": {
"status": null,
"data": {
"userID": 2,
"userName": "amankumar",
"email": "[email protected]",
"bio": "Hello Ji i am Aman Kumar verma",
"createAtTime": "2023-04-10T02:17:39.6623672",
"updateAtTime": null
}
},
"StatusCode": "OK",
"status": "success"
}